From: Dirk Lemstra Date: Thu, 29 Mar 2018 20:07:26 +0000 (+0200) Subject: Corrected patch. X-Git-Tag: 7.0.7-29~277 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cafb6660b526e1aad749ff6308218087c127c5a9;p=imagemagick Corrected patch. --- diff --git a/coders/tiff.c b/coders/tiff.c index 12f7e688b..485d28910 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -1719,18 +1719,19 @@ RestoreMSCWarning } } method=ReadGenericMethod; + rows_per_strip=image->columns*image->rows; if (TIFFGetField(tiff,TIFFTAG_ROWSPERSTRIP,&rows_per_strip) == 1) { char value[MagickPathExtent]; - if (rows_per_strip > (image->columns*image->rows)) - ThrowTIFFException(CorruptImageError,"ImproperImageHeader"); method=ReadStripMethod; (void) FormatLocaleString(value,MagickPathExtent,"%u", (unsigned int) rows_per_strip); (void) SetImageProperty(image,"tiff:rows-per-strip",value,exception); } + if (rows_per_strip > (image->columns*image->rows)) + ThrowTIFFException(CorruptImageError,"ImproperImageHeader"); if ((samples_per_pixel >= 3) && (interlace == PLANARCONFIG_CONTIG)) if ((image->alpha_trait == UndefinedPixelTrait) || (samples_per_pixel >= 4))