From 84b3f84925cc3d12eb949a283534e3d1e0761902 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Thu, 28 Nov 2013 19:08:28 +0100 Subject: [PATCH] plugins: fix memory leaks through GstVideoMeta maps. When GstVideoMeta maps were used, the supporting functions incorrectly used gst_buffer_get_memory() instead of gst_buffer_peek_memory(), thus always increasing the associated GstMemory reference count and giving zero chance to actually release that, and subsequently the VA display. --- gst/vaapi/gstvaapivideomemory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 0e3b794..cb953c1 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -123,7 +123,7 @@ gst_video_meta_map_vaapi_memory(GstVideoMeta *meta, guint plane, GstMapInfo *info, gpointer *data, gint *stride, GstMapFlags flags) { GstVaapiVideoMemory * const mem = - GST_VAAPI_VIDEO_MEMORY_CAST(gst_buffer_get_memory(meta->buffer, 0)); + GST_VAAPI_VIDEO_MEMORY_CAST(gst_buffer_peek_memory(meta->buffer, 0)); g_return_val_if_fail(mem, FALSE); g_return_val_if_fail(GST_VAAPI_IS_VIDEO_ALLOCATOR(mem->parent_instance. @@ -196,7 +196,7 @@ gst_video_meta_unmap_vaapi_memory(GstVideoMeta *meta, guint plane, GstMapInfo *info) { GstVaapiVideoMemory * const mem = - GST_VAAPI_VIDEO_MEMORY_CAST(gst_buffer_get_memory(meta->buffer, 0)); + GST_VAAPI_VIDEO_MEMORY_CAST(gst_buffer_peek_memory(meta->buffer, 0)); g_return_val_if_fail(mem, FALSE); g_return_val_if_fail(GST_VAAPI_IS_VIDEO_ALLOCATOR(mem->parent_instance. -- 2.7.4