From 45148d17fb10f707fa5bb117ec8d3f96cf561578 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Fri, 30 Mar 2018 08:27:37 +0200 Subject: [PATCH] Corrected check. --- coders/tiff.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/coders/tiff.c b/coders/tiff.c index 004af0626..2b2bc92b7 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -1720,7 +1720,8 @@ RestoreMSCWarning } } method=ReadGenericMethod; - if (TIFFGetFieldDefaulted(tiff,TIFFTAG_ROWSPERSTRIP,&rows_per_strip) == 1) + rows_per_strip=(uint32) image->rows; + if (TIFFGetField(tiff,TIFFTAG_ROWSPERSTRIP,&rows_per_strip) == 1) { char value[MagickPathExtent]; @@ -1730,7 +1731,7 @@ RestoreMSCWarning (unsigned int) rows_per_strip); (void) SetImageProperty(image,"tiff:rows-per-strip",value,exception); } - if (rows_per_strip > (image->columns*image->rows)) + if (rows_per_strip > (uint32) image->rows) ThrowTIFFException(CorruptImageError,"ImproperImageHeader"); if ((samples_per_pixel >= 3) && (interlace == PLANARCONFIG_CONTIG)) if ((image->alpha_trait == UndefinedPixelTrait) || -- 2.40.0