diff options
author | Ole André Vadla Ravnås <ole.andre.ravnas@tandberg.com> | 2008-08-21 15:28:09 +0000 |
---|---|---|
committer | Jan Schmidt <thaytan@noraisin.net> | 2009-05-16 01:29:19 +0100 |
commit | c99b497b4fc6f9b87e4836de64eb211f67670b82 (patch) | |
tree | 3bca8a8bf2f261a0484787b32db14f59610ea6c7 /sys/directdraw | |
parent | 934179d813b2e7096eb0aa4fc2fdd9e557765ef5 (diff) | |
download | gstreamer-plugins-bad-c99b497b4fc6f9b87e4836de64eb211f67670b82.tar.gz |
[MOVED FROM GOOD] sys/directdraw/gstdirectdrawsink.c: Fix buffer ref leak.
Original commit message from CVS:
Patch by: Ole André Vadla Ravnås <ole.andre.ravnas at tandberg com>
* sys/directdraw/gstdirectdrawsink.c:
(gst_directdraw_sink_show_frame):
Fix buffer ref leak.
Diffstat (limited to 'sys/directdraw')
-rw-r--r-- | sys/directdraw/gstdirectdrawsink.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/directdraw/gstdirectdrawsink.c b/sys/directdraw/gstdirectdrawsink.c index d0a318b7a..18d6178e5 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; |