]> granicus.if.org Git - imagemagick/commitdiff
https://github.com/ImageMagick/ImageMagick/issues/1020
authorCristy <urban-warrior@imagemagick.org>
Sat, 17 Mar 2018 01:07:17 +0000 (21:07 -0400)
committerCristy <urban-warrior@imagemagick.org>
Sat, 17 Mar 2018 01:07:17 +0000 (21:07 -0400)
coders/tiff.c

index f9796b5f305e5ba0a27908174c0d3321b1e108c5..da37871b6beefbb0fda30ece205818e46b1f2f00 100644 (file)
@@ -1760,8 +1760,9 @@ RestoreMSCWarning
     if (((MagickSizeType) TIFFScanlineSize(tiff)) > GetBlobSize(image))
       ThrowTIFFException(CorruptImageError,"InsufficientImageDataInFile");
     tiff_pixels=(unsigned char *) AcquireMagickMemory(MagickMax(
-      TIFFScanlineSize(tiff),(ssize_t) (image->columns*samples_per_pixel*
-      pow(2.0,ceil(log(bits_per_sample)/log(2.0)))*sizeof(uint32))));
+      TIFFScanlineSize(tiff),(ssize_t) MagickMax(image->columns*
+      samples_per_pixel*pow(2.0,ceil(log(bits_per_sample)/log(2.0))),
+      rows_per_strip)*sizeof(uint32)));
     if (tiff_pixels == (unsigned char *) NULL)
       ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed");
     switch (method)