diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-02-02 10:18:05 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2010-02-02 10:33:07 +0100 |
commit | 4914aeda2fb91c769f1ad0277ff67e7db992469a (patch) | |
tree | f2ed620f3b711c0f7d00ece8c9ff0c0f64cda859 /ext | |
parent | fd755182b17f381254058cf747d287b1a8a03ea6 (diff) |
oggdemux: Don't leak allocated buffers
This can happen if the combined flow return is not OK although the
allocation succeeded or if the packet in question is a BOS and we're
not going to push headers.
Fixes bug #608699.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/ogg/gstoggdemux.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 2d00a48f8..c6c6f05fa 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -475,7 +475,7 @@ static GstFlowReturn gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet, gboolean push_headers) { - GstBuffer *buf; + GstBuffer *buf = NULL; GstFlowReturn ret, cret; GstOggDemux *ogg = pad->ogg; gint64 current_time; @@ -647,6 +647,7 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet, /* don't push the header packets when we are asked to skip them */ if (!packet->b_o_s || push_headers) { ret = gst_pad_push (GST_PAD_CAST (pad), buf); + buf = NULL; /* combine flows */ cret = gst_ogg_demux_combine_flows (ogg, pad, ret); @@ -684,6 +685,8 @@ gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet, GST_TIME_ARGS (current_time)); done: + if (buf) + gst_buffer_unref (buf); /* return combined flow result */ return cret; |