diff options
author | Florin Apostol <florin.apostol@oregan.net> | 2015-12-16 13:59:18 +0000 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-12-16 17:19:50 +0100 |
commit | b2e689890f046d9679932347e08648b4bc2f3d93 (patch) | |
tree | ad0b2982736852409a5daab79d35645524f20ee0 /ext | |
parent | f85fc4a5432a7ad887cfec8cade6e197656171a9 (diff) | |
download | gstreamer-plugins-bad-b2e689890f046d9679932347e08648b4bc2f3d93.tar.gz |
dashdemux: improve validation of UTCtiming element
gst_mpdparser_parse_utctiming_node does not validate the parsed values completely. The following scenarios are incorrectly accepted:
- elements with no schemeIdUri property should be rejected
- elements with unrecognized UTCTiming scheme should be rejected
- elements with empty values should be rejected
The last one triggers a division by 0 in gst_dash_demux_poll_clock_drift:
clock_drift->selected_url = clock_drift->selected_url % g_strv_length (urls);
because it urls is a valid pointer to an empty array.
https://bugzilla.gnome.org/show_bug.cgi?id=759547
Diffstat (limited to 'ext')
-rw-r--r-- | ext/dash/gstmpdparser.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/dash/gstmpdparser.c b/ext/dash/gstmpdparser.c index ca52ebf6c..851099996 100644 --- a/ext/dash/gstmpdparser.c +++ b/ext/dash/gstmpdparser.c @@ -2207,6 +2207,11 @@ gst_mpdparser_parse_utctiming_node (GList ** list, xmlNode * a_node) } new_timing->urls = g_strsplit (value, " ", max_tokens); xmlFree (value); + } + + /* append to list only if both method and urls were set */ + if (new_timing->method != 0 && new_timing->urls != NULL && + g_strv_length (new_timing->urls) != 0) { *list = g_list_append (*list, new_timing); } else { gst_mpdparser_free_utctiming_node (new_timing); |