diff options
author | Sebastian Keller <skeller@gnome.org> | 2020-01-27 02:59:35 +0100 |
---|---|---|
committer | Robert Ancell <robert.ancell@canonical.com> | 2020-07-14 14:34:59 +1200 |
commit | 5432316df6b8106d279c4972ebade240edd66d13 (patch) | |
tree | 53cf73811eb33dca0e1f3af1ffe85c51246e3287 | |
parent | 43ec8f286e3d499d82735c16bbca83d7a1c03efa (diff) | |
download | gdk-pixbuf-5432316df6b8106d279c4972ebade240edd66d13.tar.gz |
GIF: Plug animation data and iterator leak
The get_static_image() method for gifs is leaking an iterator and since
the iterator has a reference to the animation, this results in all
animation frames being leaked.
-rw-r--r-- | gdk-pixbuf/io-gif-animation.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gdk-pixbuf/io-gif-animation.c b/gdk-pixbuf/io-gif-animation.c index d74296337..2c4f50a20 100644 --- a/gdk-pixbuf/io-gif-animation.c +++ b/gdk-pixbuf/io-gif-animation.c @@ -104,6 +104,7 @@ gdk_pixbuf_gif_anim_get_static_image (GdkPixbufAnimation *animation) { GdkPixbufGifAnim *gif_anim; GdkPixbufAnimationIter *iter; + GdkPixbuf *pixbuf; GTimeVal start_time = { 0, 0 }; gif_anim = GDK_PIXBUF_GIF_ANIM (animation); @@ -112,7 +113,10 @@ gdk_pixbuf_gif_anim_get_static_image (GdkPixbufAnimation *animation) return NULL; iter = gdk_pixbuf_gif_anim_get_iter (animation, &start_time); - return gdk_pixbuf_gif_anim_iter_get_pixbuf (iter); + pixbuf = gdk_pixbuf_gif_anim_iter_get_pixbuf (iter); + g_object_unref (iter); + + return pixbuf; } G_GNUC_END_IGNORE_DEPRECATIONS |