gdkpixbufsink: don't leak old pixel buffer when setting a new overlay
authorTim-Philipp Müller <tim@centricular.com>
Tue, 29 Sep 2015 10:12:48 +0000 (11:12 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 29 Sep 2015 10:12:48 +0000 (11:12 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=755773

ext/gdk_pixbuf/gstgdkpixbufoverlay.c

index 8da4076..842eca5 100644 (file)
@@ -462,6 +462,9 @@ gst_gdk_pixbuf_overlay_set_pixbuf (GstGdkPixbufOverlay * overlay,
     }
   }
 
+  if (overlay->pixels)
+    gst_buffer_unref (overlay->pixels);
+
   /* assume we have row padding even for the last row */
   /* transfer ownership of pixbuf to the buffer */
   overlay->pixels = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,