diff options
author | Even Rouault <even.rouault@spatialys.com> | 2022-01-10 21:17:19 +0000 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2022-01-10 21:17:19 +0000 |
commit | 85531e12720fb36c5e5fe4a0d50aedd7191579f6 (patch) | |
tree | 013b923cf4e09621df641971024e86a2c9319562 | |
parent | cd57b554aa906bba367d262b7b4521e935164df5 (diff) | |
parent | 8e9e8597f528e4cf39ee565d00d953e78c9e48f5 (diff) | |
download | libtiff-git-85531e12720fb36c5e5fe4a0d50aedd7191579f6.tar.gz |
Merge branch 'fix_TIFFFillStrip_wrong_check' into 'master'
Fix sanity check in TIFFFillStrip()/TIFFFillStrile()
See merge request libtiff/libtiff!288
-rw-r--r-- | libtiff/tif_read.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/libtiff/tif_read.c b/libtiff/tif_read.c index a4c60b4f..66f2e402 100644 --- a/libtiff/tif_read.c +++ b/libtiff/tif_read.c @@ -751,15 +751,12 @@ TIFFFillStrip(TIFF* tif, uint32_t strip) (bytecount - 4096) / 10 > (uint64_t)stripsize ) { uint64_t newbytecount = (uint64_t)stripsize * 10 + 4096; - if( newbytecount == 0 || newbytecount > (uint64_t)TIFF_INT64_MAX ) - { - TIFFErrorExt(tif->tif_clientdata, module, - "Too large strip byte count %"PRIu64", strip %"PRIu32". Limiting to %"PRIu64, - bytecount, - strip, - newbytecount); - bytecount = newbytecount; - } + TIFFErrorExt(tif->tif_clientdata, module, + "Too large strip byte count %"PRIu64", strip %"PRIu32". Limiting to %"PRIu64, + bytecount, + strip, + newbytecount); + bytecount = newbytecount; } } @@ -1145,15 +1142,12 @@ TIFFFillTile(TIFF* tif, uint32_t tile) (bytecount - 4096) / 10 > (uint64_t)stripsize ) { uint64_t newbytecount = (uint64_t)stripsize * 10 + 4096; - if( newbytecount == 0 || newbytecount > (uint64_t)TIFF_INT64_MAX ) - { - TIFFErrorExt(tif->tif_clientdata, module, - "Too large tile byte count %"PRIu64", tile %"PRIu32". Limiting to %"PRIu64, - bytecount, - tile, - newbytecount); - bytecount = newbytecount; - } + TIFFErrorExt(tif->tif_clientdata, module, + "Too large tile byte count %"PRIu64", tile %"PRIu32". Limiting to %"PRIu64, + bytecount, + tile, + newbytecount); + bytecount = newbytecount; } } |