Page 1 of 1

Mac PICT maskRgn problem

Posted: 2009-07-27T21:31:12-07:00
by ranvis
Hi,
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) &&

Re: Mac PICT maskRgn problem

Posted: 2009-07-28T06:24:12-07:00
by magick
Thanks for the problem report and patch. We'll get it into the next point release of ImageMagick.

Re: Mac PICT maskRgn problem

Posted: 2009-08-02T04:17:28-07:00
by ranvis
With 6.5.4-7 2009-07-31, the images are read correctly.
Thank you.