flvmux: Don't leak codec_data buffer

Use gst_buffer_replace() to prevent buffer leak

https://bugzilla.gnome.org/show_bug.cgi?id=797179
This commit is contained in:
Seungha Yang 2018-09-20 12:12:55 +09:00 committed by Sebastian Dröge
parent c6e07a6eee
commit 916ad09009

View file

@ -418,7 +418,7 @@ gst_flv_mux_video_pad_setcaps (GstFlvMuxPad * pad, GstCaps * caps)
const GValue *val = gst_structure_get_value (s, "codec_data");
if (val)
pad->codec_data = gst_buffer_ref (gst_value_get_buffer (val));
gst_buffer_replace (&pad->codec_data, gst_value_get_buffer (val));
}
gst_object_unref (mux);
@ -559,7 +559,7 @@ gst_flv_mux_audio_pad_setcaps (GstFlvMuxPad * pad, GstCaps * caps)
const GValue *val = gst_structure_get_value (s, "codec_data");
if (val)
pad->codec_data = gst_buffer_ref (gst_value_get_buffer (val));
gst_buffer_replace (&pad->codec_data, gst_value_get_buffer (val));
}
gst_object_unref (mux);