summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2017-04-07 10:39:31 +0100
committerSebastian Dröge <sebastian@centricular.com>2017-04-09 11:17:11 +0300
commit8a5d6397c184687fd56ee393a9ec46d9603d82e0 (patch)
treec1a9c9dd1af0f3a6da90b2999712ebf885b3f380
parentb817f16e19c90742a74e1083dba4d5a6f33f00e6 (diff)
mxfmux: fix index entry leak
https://bugzilla.gnome.org/show_bug.cgi?id=781023
-rw-r--r--gst/mxf/mxfmux.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gst/mxf/mxfmux.c b/gst/mxf/mxfmux.c
index c21a84d0c..7de12ac7a 100644
--- a/gst/mxf/mxfmux.c
+++ b/gst/mxf/mxfmux.c
@@ -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);
}