From: Dirk Lemstra Date: Fri, 30 Mar 2018 06:27:37 +0000 (+0200) Subject: Corrected check. X-Git-Tag: 7.0.7-29~268 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=45148d17fb10f707fa5bb117ec8d3f96cf561578;p=imagemagick Corrected check. --- 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) ||