From aae637d37ea1e9b362c6f5202a3eda6a0856df75 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Tue, 17 Oct 2017 15:13:16 +0200 Subject: Update bundled libtiff to version 4.0.8+ This updates the bundled libtiff to release 4.0.8. In addition, since after that release a number of security-related fixes has been added to the upstream CVS repository, this commit comprises the upstream changes of libtiff until 2017-10-10. (Corresponds to commit 46195f7 in the unofficial mirror at github.com/vadz/libtiff.git.) [ChangeLog][Third-Party Code] Bundled libtiff was updated to version 4.0.8+ Change-Id: I9f45387ab48383ef2635d60aeda5c74828f1a6fc Reviewed-by: Liang Qi --- src/3rdparty/libtiff/libtiff/tif_packbits.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/3rdparty/libtiff/libtiff/tif_packbits.c') diff --git a/src/3rdparty/libtiff/libtiff/tif_packbits.c b/src/3rdparty/libtiff/libtiff/tif_packbits.c index d2a0165..18904b0 100644 --- a/src/3rdparty/libtiff/libtiff/tif_packbits.c +++ b/src/3rdparty/libtiff/libtiff/tif_packbits.c @@ -1,4 +1,4 @@ -/* $Id: tif_packbits.c,v 1.24 2016-09-04 21:32:56 erouault Exp $ */ +/* $Id: tif_packbits.c,v 1.26 2017-05-14 02:26:07 erouault Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -99,7 +99,7 @@ PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) slop = (long)(op - lastliteral); tif->tif_rawcc += (tmsize_t)(lastliteral - tif->tif_rawcp); if (!TIFFFlushData1(tif)) - return (-1); + return (0); op = tif->tif_rawcp; while (slop-- > 0) *op++ = *lastliteral++; @@ -107,7 +107,7 @@ PackBitsEncode(TIFF* tif, uint8* buf, tmsize_t cc, uint16 s) } else { tif->tif_rawcc += (tmsize_t)(op - tif->tif_rawcp); if (!TIFFFlushData1(tif)) - return (-1); + return (0); op = tif->tif_rawcp; } } @@ -244,6 +244,12 @@ PackBitsDecode(TIFF* tif, uint8* op, tmsize_t occ, uint16 s) (unsigned long) ((tmsize_t)n - occ)); n = (long)occ; } + if( cc == 0 ) + { + TIFFWarningExt(tif->tif_clientdata, module, + "Terminating PackBitsDecode due to lack of data."); + break; + } occ -= n; b = *bp++; cc--; -- cgit v1.2.3