Page 1 of 1

Bug in TIFF Coder - ReadStripMethod

Posted: 2011-04-11T19:52:01-07:00
by Midi_Mick
There is a bug in ReadTiffImage when the method is the ReadStripMethod. The pointer to the pixels buffer is being regarded as an unsigned char, where the pixels returned from the TIFFReadRGBAStrip method are actually 32 bits each.

I am hoping I have this right - if anyone could review this modification it would be much appreciated.

Basically, the declaration of local variable p on line 1377(version 6.6.9) needs to be changed to a uint32*, and then the line that assigns the offset into the pixels buffer (line 1404 in version 6.6.9) needs to cast the buffer to a uint32* before calculating the offset - i.e:

Code: Select all

          p=((uint32*)pixels)+image->columns*i;
I think I have this right - discovered it by examining wornings being generated by VS2008. If anyone has a TIFF file of the appropriate structure where I could test this, I would appreciate that, too.

Cheers,

Mick

Re: Bug in TIFF Coder - ReadStripMethod

Posted: 2011-04-12T05:52:29-07:00
by magick
Thanks for the bug report, analysis, and patch. We'll get the patch in ImageMagick 6.6.9-5 Beta by sometime tomorrow.