From: Cristy Date: Fri, 23 Feb 2018 10:28:15 +0000 (-0500) Subject: https://github.com/ImageMagick/ImageMagick/issues/999 X-Git-Tag: 7.0.7-24~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5c0e1a31bc44829b1024ce599097f43285a05a42;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/999 --- diff --git a/coders/tiff.c b/coders/tiff.c index 5bc1bc871..7ffbc167a 100644 --- a/coders/tiff.c +++ b/coders/tiff.c @@ -1757,6 +1757,8 @@ RestoreMSCWarning method=ReadTileMethod; quantum_info->endian=LSBEndian; quantum_type=RGBQuantum; + 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))));