I got the corrupted images when try to convert Macintosh PICT image with the opcode DirectBitsRgn(0x009B) used.
It seems to be caused by the wrong loop condition when skipping a mask region.
ImageMagick 6.5.4-3 2009-07-15 Q16 OpenMP on Windows Vista
Code: Select all
--- ImageMagick-6.5.4-6/coders/pict.c.orig
+++ ImageMagick-6.5.4-6/coders/pict.c
@@ -1146,7 +1146,7 @@
Skip region.
*/
length=ReadBlobMSBShort(image);
- for (i=0; i <= (long) (length-2); i++)
+ for (i=0; i < (long) (length-2); i++)
(void) ReadBlobByte(image);
}
if ((code != 0x9a) && (code != 0x9b) &&