summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorSebastian Keller <skeller@gnome.org>2020-01-27 02:59:35 +0100
committerEmmanuele Bassi <ebassi@gmail.com>2020-04-02 15:45:26 +0000
commitdd3aa9ed64a0a370c8150f98e849ffc6e73da827 (patch)
treecaebcae25867ead7146e360793d64862de4251be /gdk-pixbuf
parent086e8adf4cc352cd11572f96066b001b545f354e (diff)
downloadgdk-pixbuf-dd3aa9ed64a0a370c8150f98e849ffc6e73da827.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.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-gif-animation.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdk-pixbuf/io-gif-animation.c b/gdk-pixbuf/io-gif-animation.c
index 49674fd2e..8335cdd76 100644
--- a/gdk-pixbuf/io-gif-animation.c
+++ b/gdk-pixbuf/io-gif-animation.c
@@ -105,6 +105,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);
@@ -113,7 +114,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