From 8a1c03eb94ac808cd9ba21cfcb0e2e7533fa3a01 Mon Sep 17 00:00:00 2001 From: Cristy Date: Sun, 25 Mar 2018 19:28:12 -0400 Subject: [PATCH] https://oss-fuzz.com/v2/testcase-detail/4914657606238208?noredirect=1 --- coders/tiff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coders/tiff.c b/coders/tiff.c index 72ea08313..223fe7168 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -1764,8 +1764,8 @@ RestoreMSCWarning ThrowTIFFException(CorruptImageError,"InsufficientImageDataInFile"); tiff_pixels=(unsigned char *) AcquireMagickMemory(MagickMax( TIFFScanlineSize(tiff),MagickMax((ssize_t) image->columns* - samples_per_pixel*pow(2.0,ceil(log(bits_per_sample)/log(2.0))), - image->columns*rows_per_strip)*sizeof(uint32))); + MagickMax(samples_per_pixel,3)*pow(2.0,ceil(log(bits_per_sample)/ + log(2.0))),image->columns*rows_per_strip)*sizeof(uint32))); if (tiff_pixels == (unsigned char *) NULL) ThrowTIFFException(ResourceLimitError,"MemoryAllocationFailed"); switch (method) -- 2.40.0