From: Dirk Lemstra Date: Fri, 16 Mar 2018 11:06:03 +0000 (+0100) Subject: Added extra checks to force an early exit. X-Git-Tag: 7.0.7-27~43 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c2c1622f05d9b94444c8d5fe07aa378fe18269a8;p=imagemagick Added extra checks to force an early exit. --- diff --git a/coders/pict.c b/coders/pict.c index 67972026f..017866c7b 100644 --- a/coders/pict.c +++ b/coders/pict.c @@ -500,7 +500,7 @@ static unsigned char *DecodeImage(Image *blob,Image *image, scanline_length=ReadBlobMSBShort(blob); else scanline_length=1UL*ReadBlobByte(blob); - if (scanline_length >= row_bytes) + if ((scanline_length >= row_bytes) || (scanline_length == 0)) { (void) ThrowMagickException(exception,GetMagickModule(), CorruptImageError,"UnableToUncompressImage","`%s'",image->filename); @@ -945,6 +945,8 @@ static Image *ReadPICTImage(const ImageInfo *image_info, code=ReadBlobMSBSignedShort(image); if (code < 0) break; + if (code == 0) + continue; if (code > 0xa1) { if (image->debug != MagickFalse)