From: Cristy Date: Sun, 25 Mar 2018 23:28:12 +0000 (-0400) Subject: https://oss-fuzz.com/v2/testcase-detail/4914657606238208?noredirect=1 X-Git-Tag: 7.0.7-29~301 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8a1c03eb94ac808cd9ba21cfcb0e2e7533fa3a01;p=imagemagick https://oss-fuzz.com/v2/testcase-detail/4914657606238208?noredirect=1 --- 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)