Bug in TIFF Coder - ReadStripMethod

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Midi_Mick
Posts: 5
Joined: 2006-01-18T20:25:39-07:00
Location: Australia
Contact:

Bug in TIFF Coder - ReadStripMethod

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

Re: Bug in TIFF Coder - ReadStripMethod

Post 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.
Post Reply