]> granicus.if.org Git - imagemagick/commitdiff
Fix possible buffer overflow when writing compressed TIFFS
authorCristy <urban-warrior@imagemagick.org>
Fri, 2 Dec 2016 16:06:57 +0000 (11:06 -0500)
committerCristy <urban-warrior@imagemagick.org>
Fri, 2 Dec 2016 16:06:57 +0000 (11:06 -0500)
coders/tiff.c

index 88a9d41c2bc4c70c7f8714ac0676b1bc9e97c34e..999e24f9e252e168f8e90eb8259c6df90f2c9a7e 100644 (file)
@@ -1583,9 +1583,9 @@ RestoreMSCWarning
           (unsigned int) rows_per_strip);
         (void) SetImageProperty(image,"tiff:rows-per-strip",value,exception);
       }
-    if ((samples_per_pixel >= 2) && (interlace == PLANARCONFIG_CONTIG))
+    if ((samples_per_pixel >= 3) && (interlace == PLANARCONFIG_CONTIG))
       method=ReadRGBAMethod;
-    if ((samples_per_pixel >= 2) && (interlace == PLANARCONFIG_SEPARATE))
+    if ((samples_per_pixel >= 4) && (interlace == PLANARCONFIG_SEPARATE))
       method=ReadCMYKAMethod;
     if ((photometric != PHOTOMETRIC_RGB) &&
         (photometric != PHOTOMETRIC_CIELAB) &&