You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.4 KiB

  1. From 9c45d2395863b793528518d64ddb97d8fdc200dd Mon Sep 17 00:00:00 2001
  2. From: Even Rouault <even.rouault@spatialys.com>
  3. Date: Tue, 11 Jul 2017 08:55:07 +0000
  4. Subject: [PATCH] * libtiff/tif_lzw.c: fix 4.0.8 regression in the decoding of
  5. old-style LZW compressed files.
  6. ---
  7. ChangeLog | 5 +++++
  8. libtiff/tif_lzw.c | 4 ++++
  9. 2 files changed, 9 insertions(+)
  10. diff --git a/ChangeLog b/ChangeLog
  11. index b0c84977..c5c74af7 100644
  12. --- a/ChangeLog
  13. +++ b/ChangeLog
  14. @@ -1,3 +1,8 @@
  15. +2017-07-11 Even Rouault <even.rouault at spatialys.com>
  16. +
  17. + * libtiff/tif_lzw.c: fix 4.0.8 regression in the decoding of old-style LZW
  18. + compressed files.
  19. +
  20. 2017-06-30 Even Rouault <even.rouault at spatialys.com>
  21. * libtiff/tif_dirwrite.c: in TIFFWriteDirectoryTagCheckedXXXX()
  22. diff --git a/libtiff/tif_lzw.c b/libtiff/tif_lzw.c
  23. index a2d01c90..f62b9e58 100644
  24. --- a/libtiff/tif_lzw.c
  25. +++ b/libtiff/tif_lzw.c
  26. @@ -655,6 +655,9 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
  27. }
  28. bp = (unsigned char *)tif->tif_rawcp;
  29. +#ifdef LZW_CHECKEOS
  30. + sp->dec_bitsleft = (((uint64)tif->tif_rawcc) << 3);
  31. +#endif
  32. nbits = sp->lzw_nbits;
  33. nextdata = sp->lzw_nextdata;
  34. nextbits = sp->lzw_nextbits;
  35. @@ -764,6 +767,7 @@ LZWDecodeCompat(TIFF* tif, uint8* op0, tmsize_t occ0, uint16 s)
  36. }
  37. }
  38. + tif->tif_rawcc -= (tmsize_t)( (uint8*) bp - tif->tif_rawcp );
  39. tif->tif_rawcp = (uint8*) bp;
  40. sp->lzw_nbits = (unsigned short)nbits;
  41. sp->lzw_nextdata = nextdata;