summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorGreg Rutz <greg@gsr-tek.com>2013-05-07 08:26:03 -0600
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-05-07 16:37:49 +0200
commit4d4fd09a3a00ce97dcaacb30377e350391fd64b0 (patch)
tree41f93cafc81cac0f0b597af947a91132cbf4c841 /gst
parent0511a6b0328cf4a58b905b1d379c26e2e872a68f (diff)
downloadgstreamer-plugins-bad-4d4fd09a3a00ce97dcaacb30377e350391fd64b0.tar.gz
mpegtsmux: Fix memory leak when using prepare_func
prepare_func will allocate a new buffer to replace the original one. Instead of using gst_buffer_replace (which causes an extra refcount increment on the new buffer), we just unref the original buffer. https://bugzilla.gnome.org/show_bug.cgi?id=699786
Diffstat (limited to 'gst')
-rw-r--r--gst/mpegtsmux/mpegtsmux.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c
index 78e7cbd56..ed5f98823 100644
--- a/gst/mpegtsmux/mpegtsmux.c
+++ b/gst/mpegtsmux/mpegtsmux.c
@@ -1018,9 +1018,9 @@ mpegtsmux_clip_inc_running_time (GstCollectPads * pads,
if (pad_data->prepare_func) {
MpegTsMux *mux = (MpegTsMux *) user_data;
- buf = pad_data->prepare_func (buf, pad_data, mux);
- if (buf)
- gst_buffer_replace (outbuf, buf);
+ *outbuf = pad_data->prepare_func (buf, pad_data, mux);
+ g_assert (*outbuf);
+ gst_buffer_unref (buf);
}
return GST_FLOW_OK;