summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-04-01 18:07:44 +0100
committerEmmanuele Bassi <ebassi@gmail.com>2020-04-02 14:57:03 +0000
commit1f390c595014cf3fb77113544a21acf0fdcf5c30 (patch)
tree8908a8bca68be6cc534754d4fa4b47f91e88bf6a /gdk-pixbuf
parentfc0590fee0c23cee809e508f9b2847dda46f24a4 (diff)
downloadgdk-pixbuf-1f390c595014cf3fb77113544a21acf0fdcf5c30.tar.gz
pixdata: Bail out if the error is set
We might still get a GdkPixbuf even if the GError is set, which leads to us reusing the GError instance later on.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/gdk-pixbuf-pixdata.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-pixdata.c b/gdk-pixbuf/gdk-pixbuf-pixdata.c
index 3ce5a2b40..012bd2f3e 100644
--- a/gdk-pixbuf/gdk-pixbuf-pixdata.c
+++ b/gdk-pixbuf/gdk-pixbuf-pixdata.c
@@ -75,7 +75,7 @@ main (int argc,
#endif
pixbuf = gdk_pixbuf_new_from_file (infilename, &error);
- if (!pixbuf)
+ if (error != NULL)
{
g_printerr ("failed to load \"%s\": %s\n",
argv[1],
@@ -88,6 +88,11 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
free_me = gdk_pixdata_from_pixbuf (&pixdata, pixbuf, use_rle);
data = gdk_pixdata_serialize (&pixdata, &data_len);
G_GNUC_END_IGNORE_DEPRECATIONS
+ if (data == NULL)
+ {
+ g_printerr ("failed to serialize \"%s\"", argv[1]);
+ return 1;
+ }
if (!g_file_set_contents (outfilename, (char *)data, data_len, &error))
{