tools/tiffcp.c: fix potential division by zero

Signed-off-by: Nikola Forró <nforro@redhat.com>
This commit is contained in:
Nikola Forró 2019-06-12 12:23:33 +02:00
parent 91480d3d3c
commit e897442344

View File

@ -1417,7 +1417,7 @@ DECLAREreadFunc(readSeparateTilesIntoBuffer)
uint32 row;
uint16 bps = 0, bytes_per_sample;
if (spp > (INT_MAX / tilew))
if (tilew && spp > (INT_MAX / tilew))
{
TIFFError(TIFFFileName(in), "Error, cannot handle that much samples per tile row (Tile Width * Samples/Pixel)");
return 0;