From e8974423448b2bf14102f0331d687d796ae12172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Wed, 12 Jun 2019 12:23:33 +0200 Subject: [PATCH] tools/tiffcp.c: fix potential division by zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nikola Forró --- tools/tiffcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tiffcp.c b/tools/tiffcp.c index 8c81aa4f..e36311de 100644 --- a/tools/tiffcp.c +++ b/tools/tiffcp.c @@ -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;