From 3c8e8dbc5f8f617fa902cffaa90368beb96fd8a4 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Sat, 20 Jan 2018 23:29:11 +0100 Subject: [PATCH] Corrected check and error message. Credit to OSS-Fuzz --- coders/pes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.40.0