diff options
author | erouault <erouault> | 2017-07-11 08:55:07 +0000 |
---|---|---|
committer | erouault <erouault> | 2017-07-11 08:55:07 +0000 |
commit | c4a8bf6f59d5219af73dcebb401d3accabd608b7 (patch) | |
tree | c2fb701939e30a40838b77f476117fc6d182cc5a | |
parent | 576f725ce3b531b193a2ae0eba6cb55cab06ceed (diff) | |
download | libtiff-c4a8bf6f59d5219af73dcebb401d3accabd608b7.tar.gz |
* libtiff/tif_lzw.c: fix 4.0.8 regression in the decoding of old-style LZW
compressed files.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | libtiff/tif_lzw.c | 6 |
2 files changed, 10 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2017-07-11 Even Rouault <even.rouault at spatialys.com> + + * libtiff/tif_lzw.c: fix 4.0.8 regression in the decoding of old-style LZW + compressed files. + 2017-07-10 Even Rouault <even.rouault at spatialys.com> * libtiff/tif_pixarlog.c: avoid excessive memory allocation on decoding diff --git a/libtiff/tif_lzw.c b/libtiff/tif_lzw.c index 5f1acf83..118ac696 100644 --- a/libtiff/tif_lzw.c +++ b/libtiff/tif_lzw.c @@ -1,4 +1,4 @@ -/* $Id: tif_lzw.c,v 1.55 2017-05-17 09:38:58 erouault Exp $ */ +/* $Id: tif_lzw.c,v 1.56 2017-07-11 08:55:07 erouault Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -655,6 +655,9 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s) } bp = (unsigned char *)tif->tif_rawcp; +#ifdef LZW_CHECKEOS + sp->dec_bitsleft = (((uint64)tif->tif_rawcc) << 3); +#endif nbits = sp->lzw_nbits; nextdata = sp->lzw_nextdata; nextbits = sp->lzw_nextbits; @@ -764,6 +767,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s) } } + tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp ); tif->tif_rawcp = (uint8*) bp; sp->lzw_nbits = (unsigned short)nbits; sp->lzw_nextdata = nextdata; |