From: Cristy Date: Sat, 18 Nov 2017 14:06:44 +0000 (-0500) Subject: https://github.com/ImageMagick/ImageMagick/issues/868 X-Git-Tag: 7.0.7-12~74 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1cbaa9f61214d0695870cf9e85b5a859b76da9bc;p=imagemagick https://github.com/ImageMagick/ImageMagick/issues/868 --- diff --git a/coders/pcx.c b/coders/pcx.c index 22edbce16..888054940 100644 --- a/coders/pcx.c +++ b/coders/pcx.c @@ -399,6 +399,8 @@ static Image *ReadPCXImage(const ImageInfo *image_info,ExceptionInfo *exception) pcx_packets=(size_t) image->rows*pcx_info.bytes_per_line; if (HeapOverflowSanityCheck(pcx_packets, (size_t) pcx_info.planes) != MagickFalse) ThrowPCXException(CorruptImageError,"ImproperImageHeader"); + if ((pcx_packets/8) > GetBlobSize(image)) + ThrowReaderException(CorruptImageError,"InsufficientImageDataInFile"); pcx_packets=(size_t) pcx_packets*pcx_info.planes; if ((size_t) (pcx_info.bits_per_pixel*pcx_info.planes*image->columns) > (pcx_packets*8U))