diff options
author | Even Rouault <even.rouault@spatialys.com> | 2023-04-29 12:20:46 +0200 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2023-04-29 12:20:46 +0200 |
commit | 9be22b639ea69e102d3847dca4c53ef025e9527b (patch) | |
tree | 5eeda2af572092c5c4a0d92805f5dd30547c4c7d | |
parent | 9bd48f0dbd64fb94dc2b5b05238fde0bfdd4ff3f (diff) | |
download | libtiff-git-9be22b639ea69e102d3847dca4c53ef025e9527b.tar.gz |
LZWDecode(): avoid crash when trying to read again from a strip whith a missing end-of-information marker (fixes #548)
-rw-r--r-- | libtiff/tif_lzw.c | 5 |
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); |