From: Dirk Lemstra Date: Sat, 20 Jan 2018 22:29:11 +0000 (+0100) Subject: Corrected check and error message. X-Git-Tag: 7.0.7-22~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3c8e8dbc5f8f617fa902cffaa90368beb96fd8a4;p=imagemagick Corrected check and error message. Credit to OSS-Fuzz --- diff --git a/coders/pes.c b/coders/pes.c index cc488128a..0a6031d94 100644 --- a/coders/pes.c +++ b/coders/pes.c @@ -547,10 +547,10 @@ static Image *ReadPESImage(const ImageInfo *image_info,ExceptionInfo *exception) */ j++; blocks[j].offset=(ssize_t) i; - if (j >= 256) + if (j >= 255) { stitches=(PointInfo *) RelinquishMagickMemory(stitches); - ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed"); + ThrowReaderException(ResourceLimitError,"CorruptImage"); } (void) ReadBlobByte(image); continue;