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
This commit is contained in:
Guillaume Desmottes 2015-03-27 14:41:51 +01:00 committed by Nicolas Dufresne
parent 573ce40fad
commit ca5fd56862

View file

@ -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;