From 661cb2df91b91bbeb9087d8a00a2885764c7c296 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 14 Jan 2016 15:46:35 +0100 Subject: [PATCH] pixbuf-loader: set GError on failure When gdk_pixbuf__or_image_stop_load returns FALSE, the caller can expect the GError to be set. --- gnome/pixbuf-loader.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gnome/pixbuf-loader.c b/gnome/pixbuf-loader.c index 5510b80..91c88e7 100644 --- a/gnome/pixbuf-loader.c +++ b/gnome/pixbuf-loader.c @@ -98,7 +98,6 @@ gdk_pixbuf__or_image_stop_load (gpointer data, GError **error) GdkPixbuf *pixbuf = NULL; ORRawFileRef raw_file = NULL; - (void)error; raw_file = or_rawfile_new_from_memory(context->data->data, context->data->len, OR_RAWFILE_TYPE_UNKNOWN); @@ -137,9 +136,13 @@ gdk_pixbuf__or_image_stop_load (gpointer data, GError **error) context->user_data); } result = TRUE; + } else { + g_set_error (error, + GDK_PIXBUF_ERROR, + GDK_PIXBUF_ERROR_FAILED, + "Unable to load RAW file"); } - g_byte_array_free(context->data, TRUE); free(context); return result; -- 2.5.0