Commit 75865531 authored by Bastien Nocera's avatar Bastien Nocera
Browse files

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.
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,
_("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