summaryrefslogtreecommitdiff
path: root/ext/mpeg2dec/gstmpeg2dec.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2015-03-27 14:41:51 +0100
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2015-03-30 16:19:00 -0400
commitca5fd568624366942d3548003ddc49b7ac2a3ea6 (patch)
tree375eb8f633ba75f1f2a581cc6262e38f48b781b8 /ext/mpeg2dec/gstmpeg2dec.c
parent573ce40fad3948981ebf54d876cd1b73b2e0c08e (diff)
mpeg2dec: fix buffer leak in crop_buffer()
gst_buffer_pool_acquire_buffer() gives us a new owned buffer while gst_buffer_replace() reffed it as well so we were one reference extra. https://bugzilla.gnome.org/show_bug.cgi?id=746887
Diffstat (limited to 'ext/mpeg2dec/gstmpeg2dec.c')
-rw-r--r--ext/mpeg2dec/gstmpeg2dec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/mpeg2dec/gstmpeg2dec.c b/ext/mpeg2dec/gstmpeg2dec.c
index 3ba28802..1c76cfa6 100644
--- a/ext/mpeg2dec/gstmpeg2dec.c
+++ b/ext/mpeg2dec/gstmpeg2dec.c
@@ -509,7 +509,9 @@ gst_mpeg2dec_crop_buffer (GstMpeg2dec * dec, GstVideoCodecFrame * in_frame,
if (!gst_video_frame_map (&output_frame, info, buffer, GST_MAP_WRITE))
goto map_fail;
- gst_buffer_replace (&in_frame->output_buffer, buffer);
+ if (in_frame->output_buffer)
+ gst_buffer_unref (in_frame->output_buffer);
+ in_frame->output_buffer = buffer;
if (!gst_video_frame_copy (&output_frame, input_vframe))
goto copy_failed;