From 7f27287256656d14f269fb42f48c5e5a64f11d23 Mon Sep 17 00:00:00 2001 From: Ole André Vadla Ravnås Date: Thu, 21 Aug 2008 15:28:09 +0000 Subject: sys/directdraw/gstdirectdrawsink.c: Fix buffer ref leak. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message from CVS: Patch by: Ole André Vadla Ravnås * sys/directdraw/gstdirectdrawsink.c: (gst_directdraw_sink_show_frame): Fix buffer ref leak. --- sys/directdraw/gstdirectdrawsink.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'sys/directdraw/gstdirectdrawsink.c') diff --git a/sys/directdraw/gstdirectdrawsink.c b/sys/directdraw/gstdirectdrawsink.c index d0a318b7..18d6178e 100644 --- a/sys/directdraw/gstdirectdrawsink.c +++ b/sys/directdraw/gstdirectdrawsink.c @@ -800,12 +800,10 @@ gst_directdraw_sink_show_frame (GstBaseSink * bsink, GstBuffer * buf) if (buf) { /* save a reference to the input buffer */ - if (ddrawsink->last_buffer != buf) { - if (ddrawsink->last_buffer) { - gst_buffer_unref (ddrawsink->last_buffer); - } - } - ddrawsink->last_buffer = gst_buffer_ref (buf); + gst_buffer_ref (buf); + if (ddrawsink->last_buffer != NULL) + gst_buffer_unref (ddrawsink->last_buffer); + ddrawsink->last_buffer = buf; } else { /* use last buffer */ buf = ddrawsink->last_buffer; -- cgit