summaryrefslogtreecommitdiff
path: root/libtiff/tif_predict.h
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2016-10-31 17:24:26 +0000
committerEven Rouault <even.rouault@spatialys.com>2016-10-31 17:24:26 +0000
commita41c294c3fa70d750aeb124947cd551b64f68b9c (patch)
treea1939829a83e0f2258d0261e66771489ac0b3aaf /libtiff/tif_predict.h
parent124d8fc8109f32e2039fa4e5306117078783b958 (diff)
downloadlibtiff-git-a41c294c3fa70d750aeb124947cd551b64f68b9c.tar.gz
* libtiff/tif_predict.h, libtiff/tif_predict.c:
Replace assertions by runtime checks to avoid assertions in debug mode, or buffer overflows in release mode. Can happen when dealing with unusual tile size like YCbCr with subsampling. Reported as MSVR 35105 by Axel Souchet & Vishal Chauhan from the MSRC Vulnerabilities & Mitigations team.
Diffstat (limited to 'libtiff/tif_predict.h')
-rw-r--r--libtiff/tif_predict.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/libtiff/tif_predict.h b/libtiff/tif_predict.h
index dc7144c6..6c68e21a 100644
--- a/libtiff/tif_predict.h
+++ b/libtiff/tif_predict.h
@@ -1,4 +1,4 @@
-/* $Id: tif_predict.h,v 1.8 2010-03-10 18:56:49 bfriesen Exp $ */
+/* $Id: tif_predict.h,v 1.9 2016-10-31 17:24:26 erouault Exp $ */
/*
* Copyright (c) 1995-1997 Sam Leffler
@@ -30,6 +30,8 @@
* ``Library-private'' Support for the Predictor Tag
*/
+typedef int (*TIFFEncodeDecodeMethod)(TIFF* tif, uint8* buf, tmsize_t size);
+
/*
* Codecs that want to support the Predictor tag must place
* this structure first in their private state block so that
@@ -43,12 +45,12 @@ typedef struct {
TIFFCodeMethod encoderow; /* parent codec encode/decode row */
TIFFCodeMethod encodestrip; /* parent codec encode/decode strip */
TIFFCodeMethod encodetile; /* parent codec encode/decode tile */
- TIFFPostMethod encodepfunc; /* horizontal differencer */
+ TIFFEncodeDecodeMethod encodepfunc; /* horizontal differencer */
TIFFCodeMethod decoderow; /* parent codec encode/decode row */
TIFFCodeMethod decodestrip; /* parent codec encode/decode strip */
TIFFCodeMethod decodetile; /* parent codec encode/decode tile */
- TIFFPostMethod decodepfunc; /* horizontal accumulator */
+ TIFFEncodeDecodeMethod decodepfunc; /* horizontal accumulator */
TIFFVGetMethod vgetparent; /* super-class method */
TIFFVSetMethod vsetparent; /* super-class method */