]> granicus.if.org Git - imagemagick/commitdiff
Minor refactor
authorDirk Lemstra <dirk@git.imagemagick.org>
Thu, 29 Mar 2018 20:00:19 +0000 (22:00 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Thu, 29 Mar 2018 20:00:19 +0000 (22:00 +0200)
coders/tiff.c

index c9a12cc09f5441fbd542b9ada5989c7a87a6f8de..12f7e688b9e55cb339c2b1118e75e9416cf807d0 100644 (file)
@@ -1724,12 +1724,12 @@ RestoreMSCWarning
         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) ||