[Mono-dev] Patch: properly ignore PNG icon entries - fixes crash in resgen2

David Hammerton davidjdh at gmail.com
Fri Mar 7 19:43:57 EST 2008


Hi all,

Attached is a patch so that, when deserializing an icon, PNG icons are
properly ignored, and the number of icon entries is updated to reflect this.

Presently, when mono comes across a PNG icon entry, it doesn't read it, but
it also doesn't update the size of the icon directory array.. This causes a
crash in SaveIconImage(...) when it hits the last entry in the array (which
was never read, so ii.iconColors was never initialized etc).

This patch makes sure that if we *do* come accross a PNG icon, we not only
skip it, but we make sure it we reduce the icon count properly, so we wont
try to write an icon entry that was never read...

Of course, the real fix would be to read the PNG icon and write it again..
But this should at least help for now!

David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080308/78b8f373/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: icon_ignore_png.diff
Type: text/x-patch
Size: 1283 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080308/78b8f373/attachment.bin 


More information about the Mono-devel-list mailing list