]> granicus.if.org Git - imagemagick/commitdiff
Fixed use of uninitialized value.
authorDirk Lemstra <dirk@git.imagemagick.org>
Thu, 29 Mar 2018 19:58:44 +0000 (21:58 +0200)
committerDirk Lemstra <dirk@git.imagemagick.org>
Thu, 29 Mar 2018 19:58:44 +0000 (21:58 +0200)
coders/tiff.c

index 72ea083132ddd19ab75d8d3d2ccdb20d88e693c3..c9a12cc09f5441fbd542b9ada5989c7a87a6f8de 100644 (file)
@@ -1728,9 +1728,9 @@ RestoreMSCWarning
         (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 (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))