summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFlorin Apostol <florin.apostol@oregan.net>2015-06-12 16:44:55 +0100
committerSebastian Dröge <sebastian@centricular.com>2015-06-12 22:45:51 +0200
commitb23e4452a2366490a6203e616adf74eb97aab327 (patch)
treeb0794ced8b27061bd2b74d75293e41fca92adac0 /tests
parent62f25894a5863b2617b91e62af46d55c4a4eb127 (diff)
downloadgstreamer-plugins-bad-b23e4452a2366490a6203e616adf74eb97aab327.tar.gz
dashdemux: fixed segfault for missing default namespace
Added a check for a_node->ns before accessing a_node->ns->href in gst_mpdparser_get_xml_node_namespace. This could happen if the xml is missing the default namespace. https://bugzilla.gnome.org/show_bug.cgi?id=750866
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/dash_mpd.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/check/elements/dash_mpd.c b/tests/check/elements/dash_mpd.c
index a30baf4c0..faa3e5894 100644
--- a/tests/check/elements/dash_mpd.c
+++ b/tests/check/elements/dash_mpd.c
@@ -413,6 +413,27 @@ GST_START_TEST (dash_mpdparser_no_end_tag)
GST_END_TEST;
/*
+ * Test parsing an MPD with no default namespace
+ */
+GST_START_TEST (dash_mpdparser_no_default_namespace)
+{
+ const gchar *xml =
+ "<?xml version=\"1.0\"?>"
+ "<MPD profiles=\"urn:mpeg:dash:profile:isoff-main:2011\"></MPD>";
+
+ gboolean ret;
+ GstMpdClient *mpdclient = gst_mpd_client_new ();
+
+ ret = gst_mpd_parse (mpdclient, xml, strlen (xml));
+
+ assert_equals_int (ret, TRUE);
+
+ gst_mpd_client_free (mpdclient);
+}
+
+GST_END_TEST;
+
+/*
* create a test suite containing all dash testcases
*/
static Suite *
@@ -444,6 +465,7 @@ dash_suite (void)
tcase_add_test (tc_negativeTests, dash_mpdparser_missing_xml);
tcase_add_test (tc_negativeTests, dash_mpdparser_missing_mpd);
tcase_add_test (tc_negativeTests, dash_mpdparser_no_end_tag);
+ tcase_add_test (tc_negativeTests, dash_mpdparser_no_default_namespace);
suite_add_tcase (s, tc_simpleMPD);
suite_add_tcase (s, tc_negativeTests);