From f35f0b6548eebb4dd79b37152644efc24e356d44 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 18 Jun 2012 12:17:12 +0200 Subject: [PATCH] sys: fix some bufferpool leaks --- sys/ximage/ximagesink.c | 7 ++++--- sys/xvimage/xvimagesink.c | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sys/ximage/ximagesink.c b/sys/ximage/ximagesink.c index a1e9bf023b..f47e7d3983 100644 --- a/sys/ximage/ximagesink.c +++ b/sys/ximage/ximagesink.c @@ -1459,12 +1459,12 @@ gst_ximagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query) if (pool == NULL && need_pool) { GstVideoInfo info; - GST_DEBUG_OBJECT (ximagesink, "create new pool"); - pool = gst_ximage_buffer_pool_new (ximagesink); - if (!gst_video_info_from_caps (&info, caps)) goto invalid_caps; + GST_DEBUG_OBJECT (ximagesink, "create new pool"); + pool = gst_ximage_buffer_pool_new (ximagesink); + /* the normal size of a frame */ size = info.size; @@ -1499,6 +1499,7 @@ invalid_caps: config_failed: { GST_DEBUG_OBJECT (bsink, "failed setting config"); + gst_object_unref (pool); return FALSE; } } diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 087ab540b6..ed2f10c941 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -1970,12 +1970,12 @@ gst_xvimagesink_propose_allocation (GstBaseSink * bsink, GstQuery * query) if (pool == NULL && need_pool) { GstVideoInfo info; - GST_DEBUG_OBJECT (xvimagesink, "create new pool"); - pool = gst_xvimage_buffer_pool_new (xvimagesink); - if (!gst_video_info_from_caps (&info, caps)) goto invalid_caps; + GST_DEBUG_OBJECT (xvimagesink, "create new pool"); + pool = gst_xvimage_buffer_pool_new (xvimagesink); + /* the normal size of a frame */ size = info.size; @@ -2010,6 +2010,7 @@ invalid_caps: config_failed: { GST_DEBUG_OBJECT (bsink, "failed setting config"); + gst_object_unref (pool); return FALSE; } }