summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2013-02-19 12:09:29 +0100
committerBenjamin Otte <otte@redhat.com>2013-02-19 12:12:19 +0100
commit42ab066bfeeee5047d411bcf2e1af9c977561b7c (patch)
tree49ea6a9018d40d98ee54c4697f1ccdc1ccaa9b97
parenta6ee454b28c1a801e8417285eb40f2217c3f0319 (diff)
downloadgdk-pixbuf-42ab066bfeeee5047d411bcf2e1af9c977561b7c.tar.gz
animation: gdk_pixbuf_animation_new_from_file() can't load PNG files
The code assumed that the prepare callback was called in the begin_load() opeartion, which is not true. So we change the code to only require that the prepare callback be called at all. https://bugzilla.gnome.org/show_bug.cgi?id=694148
-rw-r--r--gdk-pixbuf/gdk-pixbuf-animation.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-animation.c b/gdk-pixbuf/gdk-pixbuf-animation.c
index 2ea54052f..38d30f58c 100644
--- a/gdk-pixbuf/gdk-pixbuf-animation.c
+++ b/gdk-pixbuf/gdk-pixbuf-animation.c
@@ -224,7 +224,7 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
context = image_module->begin_load (NULL, prepared_notify, NULL, &animation, error);
- if (!context || !animation) {
+ if (!context) {
error = NULL;
goto fail_progressive_load;
}
@@ -248,6 +248,9 @@ fail_progressive_load:
g_free (display_name);
return NULL;
}
+
+ /* If there was no error, there must be an animation that was successfully loaded */
+ g_assert (animation);
} else {
GdkPixbuf *pixbuf;