in the WriteOnePNGImage() function, an array opaque is defined:
Code: Select all
PixelPacket opaque[260]
Under windows, in the debug version of convert.exe, this causes an assertion failure warning about the stack that has been corrupted around the opaque variable:
"Run-Time Check Failure #2 - Stack around the variable 'opaque' was corrupted."
Under *nix variants, the bug probably exists as well, but might not manifest itself.
imagemagick source: 6.6.7
windows version: windows xp, sp3 (5.1, build 2600)
visual studio version: 2008
affected code, all in coders/png.c:
Code: Select all
// definition:
PixelPacket // line 7008-7010
...
opaque[260],
Code: Select all
// usage of the opaque variable: number_opaque can have a maximum value of 299, which causes the code to set values outside of the opaque array.
if (colormap[i].opacity == OpaqueOpacity) // line 7142-7143
opaque[number_opaque++] = colormap[i];
Code: Select all
PixelPacket // line 7008-7012
semitransparent[260],
transparent[260];
Roland