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.
This commit is contained in:
parent
fd755182b1
commit
4914aeda2f
@ -475,7 +475,7 @@ static GstFlowReturn
|
|||||||
gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
|
gst_ogg_demux_chain_peer (GstOggPad * pad, ogg_packet * packet,
|
||||||
gboolean push_headers)
|
gboolean push_headers)
|
||||||
{
|
{
|
||||||
GstBuffer *buf;
|
GstBuffer *buf = NULL;
|
||||||
GstFlowReturn ret, cret;
|
GstFlowReturn ret, cret;
|
||||||
GstOggDemux *ogg = pad->ogg;
|
GstOggDemux *ogg = pad->ogg;
|
||||||
gint64 current_time;
|
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 */
|
/* don't push the header packets when we are asked to skip them */
|
||||||
if (!packet->b_o_s || push_headers) {
|
if (!packet->b_o_s || push_headers) {
|
||||||
ret = gst_pad_push (GST_PAD_CAST (pad), buf);
|
ret = gst_pad_push (GST_PAD_CAST (pad), buf);
|
||||||
|
buf = NULL;
|
||||||
|
|
||||||
/* combine flows */
|
/* combine flows */
|
||||||
cret = gst_ogg_demux_combine_flows (ogg, pad, ret);
|
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));
|
GST_TIME_ARGS (current_time));
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
if (buf)
|
||||||
|
gst_buffer_unref (buf);
|
||||||
/* return combined flow result */
|
/* return combined flow result */
|
||||||
return cret;
|
return cret;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user