Mac PICT maskRgn problem

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
ranvis

Mac PICT maskRgn problem

Post 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) &&
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Mac PICT maskRgn problem

Post by magick »

Thanks for the problem report and patch. We'll get it into the next point release of ImageMagick.
ranvis

Re: Mac PICT maskRgn problem

Post by ranvis »

With 6.5.4-7 2009-07-31, the images are read correctly.
Thank you.
Post Reply