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-05-08 18:05:02 +0200
commit6b8b725e5086fe2300610e5f1e82920e67443481 (patch)
treebc701e43cc9f3d2adbc0d0fabb018a3cf7b209f3
parent17215f65c916f6f7ff6430734c47c4936da3d3d0 (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);
}