gdkpixbufsink: don't leak old pixel buffer when setting a new overlay

https://bugzilla.gnome.org/show_bug.cgi?id=755773
This commit is contained in:
Tim-Philipp Müller 2015-09-29 11:12:48 +01:00
parent 6c09710292
commit d77891406d

View 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 */ /* assume we have row padding even for the last row */
/* transfer ownership of pixbuf to the buffer */ /* transfer ownership of pixbuf to the buffer */
overlay->pixels = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY, overlay->pixels = gst_buffer_new_wrapped_full (GST_MEMORY_FLAG_READONLY,