mxfmux: fix index entry leak

https://bugzilla.gnome.org/show_bug.cgi?id=781023
This commit is contained in:
Vincent Penquerc'h 2017-04-07 10:39:31 +01:00 committed by Sebastian Dröge
parent b817f16e19
commit 8a5d6397c1

View file

@ -208,6 +208,10 @@ gst_mxf_mux_finalize (GObject * object)
}
if (mux->index_table) {
gsize n;
for (n = 0; n < mux->index_table->len; ++n)
g_free (g_array_index (mux->index_table, MXFIndexTableSegment,
n).index_entries);
g_array_free (mux->index_table, TRUE);
mux->index_table = NULL;
}
@ -219,6 +223,7 @@ static void
gst_mxf_mux_reset (GstMXFMux * mux)
{
GList *l;
gsize n;
GST_OBJECT_LOCK (mux);
for (l = GST_ELEMENT_CAST (mux)->sinkpads; l; l = l->next) {
@ -255,6 +260,10 @@ gst_mxf_mux_reset (GstMXFMux * mux)
mux->last_gc_position = 0;
mux->offset = 0;
if (mux->index_table)
for (n = 0; n < mux->index_table->len; ++n)
g_free (g_array_index (mux->index_table, MXFIndexTableSegment,
n).index_entries);
g_array_set_size (mux->index_table, 0);
}