diff options
author | Edward Hervey <edward@centricular.com> | 2017-11-01 11:18:12 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2017-12-01 10:02:03 +0100 |
commit | 01ca62e593dc9f9b027ddd3235b8d922ea04a652 (patch) | |
tree | 3d7892dd8b6731dfc1a43d720bfc1445bba77032 | |
parent | 298bd9d82fa3632cc00f727c673e50064d422d9f (diff) | |
download | gstreamer-plugins-base-01ca62e593dc9f9b027ddd3235b8d922ea04a652.tar.gz |
oggdemux: Fix chain leak in push mode
In some corner cases we end up with the building chain not being
properly tracked (and therefore not properly freed).
Add a FIXME so it can later be fixed, but for now just fix the leak
-rw-r--r-- | ext/ogg/gstoggdemux.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/ext/ogg/gstoggdemux.c b/ext/ogg/gstoggdemux.c index 5307521fb..084d5d5f0 100644 --- a/ext/ogg/gstoggdemux.c +++ b/ext/ogg/gstoggdemux.c @@ -4966,11 +4966,23 @@ gst_ogg_demux_clear_chains (GstOggDemux * ogg) for (i = 0; i < ogg->chains->len; i++) { GstOggChain *chain = g_array_index (ogg->chains, GstOggChain *, i); + if (chain == ogg->current_chain) + ogg->current_chain = NULL; + if (chain == ogg->building_chain) + ogg->building_chain = NULL; gst_ogg_chain_free (chain); } ogg->chains = g_array_set_size (ogg->chains, 0); - ogg->current_chain = NULL; - ogg->building_chain = NULL; + if (ogg->current_chain != NULL) { + GST_FIXME_OBJECT (ogg, "current chain was tracked in existing chains !"); + gst_ogg_chain_free (ogg->current_chain); + ogg->current_chain = NULL; + } + if (ogg->building_chain != NULL) { + GST_FIXME_OBJECT (ogg, "building chain was tracked in existing chains !"); + gst_ogg_chain_free (ogg->building_chain); + ogg->building_chain = NULL; + } GST_CHAIN_UNLOCK (ogg); } |