]> granicus.if.org Git - imagemagick/commitdiff
Corrected check.
authorDirk Lemstra <dirk@git.imagemagick.org>
Fri, 30 Mar 2018 06:27:37 +0000 (08:27 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Fri, 30 Mar 2018 06:29:50 +0000 (08:29 +0200)
coders/tiff.c

index 004af06265a8bb2238134e997a537238085c2b2f..2b2bc92b70f38259ff0de76ec12103288383a876 100644 (file)
@@ -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) ||