Merge branch 'division-by-zero' into 'master'

tools/tiffcp.c: fix potential division by zero

See merge request libtiff/libtiff!83
This commit is contained in:
Even Rouault 2020-02-26 21:37:54 +00:00
commit 06d6e36187

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;