smoothstreaming: Handle invalid XML

Nothing guarantees the manifest is valid and will return a root node
This commit is contained in:
Edward Hervey 2017-11-21 15:33:57 +01:00 committed by Edward Hervey
parent 26108d829b
commit 6e1e87d403

View file

@ -354,6 +354,11 @@ gst_mss_manifest_new (GstBuffer * data)
manifest->xml = xmlReadMemory ((const gchar *) mapinfo.data,
mapinfo.size, "manifest", NULL, 0);
root = manifest->xmlrootnode = xmlDocGetRootElement (manifest->xml);
if (root == NULL) {
GST_WARNING ("No root node ! Invalid manifest");
gst_mss_manifest_free (manifest);
return NULL;
}
live_str = (gchar *) xmlGetProp (root, (xmlChar *) "IsLive");
if (live_str) {