From ce70d17ee6fca89de4361a0f680aaf40b120f32a Mon Sep 17 00:00:00 2001 From: skal Date: Thu, 12 Nov 2020 15:41:14 +0000 Subject: [PATCH] Fix potential overflow in gtStripContig() (w + w) might not fit in int32 if too large. --- libtiff/tif_getimage.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libtiff/tif_getimage.c b/libtiff/tif_getimage.c index 4da785d3..194feb36 100644 --- a/libtiff/tif_getimage.c +++ b/libtiff/tif_getimage.c @@ -936,6 +936,10 @@ gtStripContig(TIFFRGBAImage* img, uint32* raster, uint32 w, uint32 h) flip = setorientation(img); if (flip & FLIP_VERTICALLY) { + if ( w > 0x7FFFFFFFu ) { + TIFFErrorExt(tif->tif_clientdata, TIFFFileName(tif), "Width overflow"); + return (0); + } y = h - 1; toskew = -(int32)(w + w); } else {