]> granicus.if.org Git - imagemagick/commitdiff
Corrected check and error message.
authorDirk Lemstra <dirk@git.imagemagick.org>
Sat, 20 Jan 2018 22:29:11 +0000 (23:29 +0100)
committerDirk Lemstra <dirk@git.imagemagick.org>
Sat, 20 Jan 2018 22:29:47 +0000 (23:29 +0100)
Credit to OSS-Fuzz

coders/pes.c

index cc488128a6a6ded8a0259cc7e7b427cde798ea1f..0a6031d94f6d14755b4b69fc11a4dd45e1bd3078 100644 (file)
@@ -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;