[gdk-pixbuf/gdk-pixbuf-2-40] GIF: Plug animation data and iterator leak
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf/gdk-pixbuf-2-40] GIF: Plug animation data and iterator leak
- Date: Tue, 14 Jul 2020 02:35:38 +0000 (UTC)
commit 5432316df6b8106d279c4972ebade240edd66d13
Author: Sebastian Keller <skeller gnome org>
Date: Mon Jan 27 02:59:35 2020 +0100
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.
gdk-pixbuf/io-gif-animation.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]