summaryrefslogtreecommitdiff
path: root/gst/mxf/mxftypes.c
diff options
context:
space:
mode:
authorEdward Hervey <edward@collabora.com>2014-04-16 16:19:47 +0200
committerEdward Hervey <edward@collabora.com>2014-04-16 16:19:47 +0200
commitbe859d02a6a7f3cf0877e0f320aab36b11879d23 (patch)
tree034cc290ad965ea1706958dff60a2878576b93d7 /gst/mxf/mxftypes.c
parentfa72b4c87091b416249fe268cf3f981937935a10 (diff)
downloadgstreamer-plugins-bad-be859d02a6a7f3cf0877e0f320aab36b11879d23.tar.gz
mxf: Handle fraction parsing failure
And properly cleanup/reset the segment before returning on errors CID #206012
Diffstat (limited to 'gst/mxf/mxftypes.c')
-rw-r--r--gst/mxf/mxftypes.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gst/mxf/mxftypes.c b/gst/mxf/mxftypes.c
index bbcdb5567..55ac8be0b 100644
--- a/gst/mxf/mxftypes.c
+++ b/gst/mxf/mxftypes.c
@@ -1254,7 +1254,8 @@ mxf_index_table_segment_parse (const MXFUL * ul,
entry->pos_table = g_new0 (MXFFraction, segment->pos_table_count);
for (j = 0; j < segment->pos_table_count; j++) {
- mxf_fraction_parse (&entry->pos_table[j], tag_data, tag_size);
+ if (!mxf_fraction_parse (&entry->pos_table[j], tag_data, tag_size))
+ goto error;
tag_data += 8;
tag_size -= 8;
GST_DEBUG (" pos table %u = %d/%d", j, entry->pos_table[j].n,
@@ -1281,6 +1282,7 @@ mxf_index_table_segment_parse (const MXFUL * ul,
error:
GST_ERROR ("Invalid index table segment");
+ mxf_index_table_segment_reset (segment);
return FALSE;
}