GNOME Bugzilla – Bug 768484
Set errors on broken ico headers to avoid asserts / warnings
Last modified: 2016-08-03 16:51:54 UTC
Created attachment 330946 [details] [review] patch to set correct error in io-ico.c The attached patch will set correct errors in certain situations when a broken ico header is detected in io-ico.c. On a malformed file that gets detected as an ico the missing error will either cause a warning like this: (process:15365): GdkPixbuf-WARNING **: Bug! gdk-pixbuf loader 'ico' didn't set an error on failure. Or even an assert if compiled with it: GdkPixbuf:ERROR:gdk-pixbuf-animation.c:247:gdk_pixbuf_animation_new_from_file: assertion failed: (animation) I'll also attach a minimal file triggering the bug. (This bug was discovered with the help of american fuzzy lop)
Created attachment 330947 [details] example file
It would be great if you could attach git-formatted patches with commit messages. Thanks for the fix anyway!
I actually ended up reverting this change in the commit, since it turned out to be broken. DecodeHeader is supposed to return without setting an error in these cases, since we may be loading incrementally, and need to wait for more data.