Fix bad overflow check in ReadTIFF()

See ImgIoUtilCheckSizeArgumentsOverflow() usage at line 199.

Change-Id: Iecad9278446a2f189e287e08512d26a794270a5a
This commit is contained in:
Yannis Guyon 2022-02-15 17:51:14 +01:00
parent 54e61a3864
commit 66b3ce239e

View File

@ -212,7 +212,7 @@ int ReadTIFF(const uint8_t* const data, size_t data_size,
TIFFGetField(tif, TIFFTAG_TILELENGTH, &tile_height)) {
if ((tile_width > 32 && tile_width / 2 > image_width) ||
(tile_height > 32 && tile_height / 2 > image_height) ||
ImgIoUtilCheckSizeArgumentsOverflow(
!ImgIoUtilCheckSizeArgumentsOverflow(
(uint64_t)tile_width * sizeof(*raster), tile_height)) {
fprintf(stderr, "Error! TIFF tile dimension (%d x %d) is too large.\n",
tile_width, tile_height);