dashdemux: improve validation of UTCtiming element
authorFlorin Apostol <florin.apostol@oregan.net>
Wed, 16 Dec 2015 13:59:18 +0000 (13:59 +0000)
committerSebastian Dröge <sebastian@centricular.com>
Wed, 16 Dec 2015 16:19:50 +0000 (17:19 +0100)
commitb2e689890f046d9679932347e08648b4bc2f3d93
treead0b2982736852409a5daab79d35645524f20ee0
parentf85fc4a5432a7ad887cfec8cade6e197656171a9
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
ext/dash/gstmpdparser.c
tests/check/elements/dash_mpd.c