Commit 75865531 authored by Bastien Nocera's avatar Bastien Nocera

ico: Return an error when the ICO didn't load

If we don't even read enough data to fill the header, return an
error. This doesn't cover everything that could go wrong with
the ICO incremental loader, but this is a good first throw.

https://bugzilla.gnome.org/show_bug.cgi?id=778204
parent 57362ed4
......@@ -610,6 +610,7 @@ gdk_pixbuf__ico_image_stop_load(gpointer data,
{
struct ico_progressive_state *context =
(struct ico_progressive_state *) data;
gboolean ret = TRUE;
/* FIXME this thing needs to report errors if
* we have unused image data
......@@ -617,8 +618,16 @@ gdk_pixbuf__ico_image_stop_load(gpointer data,
g_return_val_if_fail(context != NULL, TRUE);
if (context->HeaderDone < context->HeaderSize) {
g_set_error_literal (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,
_("ICO image was truncated or incomplete."));
ret = FALSE;
}
context_free (context);
return TRUE;
return ret;
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment