diff options
author | Benjamin Otte <otte@redhat.com> | 2013-03-12 21:41:34 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2013-03-12 21:55:07 +0100 |
commit | ff7e0f385b4c3f63b43b474a0a43e975c1881ebb (patch) | |
tree | 3cbc28be0f6b8f077693ffaf67cb403efd95d879 | |
parent | fb0cbc9c9851e0224b5e228dbe06bfec363f63af (diff) | |
download | gdk-pixbuf-ff7e0f385b4c3f63b43b474a0a43e975c1881ebb.tar.gz |
animation: Allow prepare_func call in stop_load
Move the assertion that prepare_func was called after the stop_load
call. Makes the XPM loader not die.
https://bugzilla.gnome.org/show_bug.cgi?id=695228
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-animation.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf-animation.c b/gdk-pixbuf/gdk-pixbuf-animation.c index e39a5927c..911bf41aa 100644 --- a/gdk-pixbuf/gdk-pixbuf-animation.c +++ b/gdk-pixbuf/gdk-pixbuf-animation.c @@ -238,8 +238,6 @@ gdk_pixbuf_animation_new_from_file (const char *filename, } } - /* If there was no error, there must be an animation that was successfully loaded */ - g_assert (animation); success = TRUE; fail_load_increment: @@ -249,9 +247,14 @@ fail_load_increment: fail_begin_load: fclose (f); - if (!success && animation) { - g_object_unref (animation); - animation = NULL; + if (success) { + /* If there was no error, there must be an animation that was successfully loaded */ + g_assert (animation); + } else { + if (animation) { + g_object_unref (animation); + animation = NULL; + } } } else { GdkPixbuf *pixbuf; |