From 23f6beef78cfe806cabc090a015e73557d60788e Mon Sep 17 00:00:00 2001 From: Cristy Date: Fri, 16 Mar 2018 21:07:17 -0400 Subject: [PATCH] https://github.com/ImageMagick/ImageMagick/issues/1020 --- coders/tiff.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/coders/tiff.c b/coders/tiff.c index f9796b5f3..da37871b6 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -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) -- 2.40.0