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

Sebastien Pouliot sebastien.pouliot at gmail.com
Mon Mar 10 16:48:46 EDT 2008


Hey,

It would probably be easier just to avoid saving this empty entry than
re-allocating and copying all the icons. 

Could you supply a test case, or at least the stack trace, to a bug
report ?

Thanks
Sebastien

On Sat, 2008-03-08 at 11:43 +1100, David Hammerton wrote:
> 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.
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list