diff options
author | Liang Qi <liang.qi@qt.io> | 2017-10-30 08:44:39 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-10-30 09:07:52 +0100 |
commit | e5c4a6f82b83a1bf27380c071e822d5303642824 (patch) | |
tree | 5f16389c799eba64ea581ac63ee9d6b4da8bb3c1 /src/3rdparty/libtiff/libtiff/tif_packbits.c | |
parent | 36fdeb50941e3e2b0c4cd1b3343c3e337534357d (diff) | |
parent | feca51d8c714781378cecc99122035348e0459bb (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10v5.10.0-beta4
Conflicts:
.qmake.conf
Change-Id: I84737121b8915a6c358ad92246984749e2719bed
Diffstat (limited to 'src/3rdparty/libtiff/libtiff/tif_packbits.c')
-rw-r--r-- | src/3rdparty/libtiff/libtiff/tif_packbits.c | 12 |
1 files changed, 9 insertions, 3 deletions
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--; |