summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2023-05-06 18:47:00 +0000
committerEven Rouault <even.rouault@spatialys.com>2023-05-06 18:47:00 +0000
commit7e28cd362b9b7ca984b685562ee945dacdc2c50e (patch)
tree0386c17cc316fae57d7d9d25e0e820543e570a9a
parent7ead6c42c70636c0ffec2e9ff3f16d614e37fb7b (diff)
parent9be22b639ea69e102d3847dca4c53ef025e9527b (diff)
downloadlibtiff-git-7e28cd362b9b7ca984b685562ee945dacdc2c50e.tar.gz
Merge branch 'fix_548' into 'master'
LZWDecode(): avoid crash when trying to read again from a strip whith a... Closes #548 See merge request libtiff/libtiff!484
-rw-r--r--libtiff/tif_lzw.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libtiff/tif_lzw.c b/libtiff/tif_lzw.c
index ba75a07e..d631fa10 100644
--- a/libtiff/tif_lzw.c
+++ b/libtiff/tif_lzw.c
@@ -423,6 +423,10 @@ static int LZWDecode(TIFF *tif, uint8_t *op0, tmsize_t occ0, uint16_t s)
if (sp->read_error)
{
+ TIFFErrorExtR(tif, module,
+ "LZWDecode: Scanline %" PRIu32 " cannot be read due to "
+ "previous error",
+ tif->tif_row);
return 0;
}
@@ -742,6 +746,7 @@ after_loop:
return (1);
no_eoi:
+ sp->read_error = 1;
TIFFErrorExtR(tif, module,
"LZWDecode: Strip %" PRIu32 " not terminated with EOI code",
tif->tif_curstrip);