From 6e1e87d403e753b76d8b084ffd434ea98d5c7ef8 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 21 Nov 2017 15:33:57 +0100 Subject: [PATCH] smoothstreaming: Handle invalid XML Nothing guarantees the manifest is valid and will return a root node --- ext/smoothstreaming/gstmssmanifest.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c index 2085b364de..c855cb3878 100644 --- a/ext/smoothstreaming/gstmssmanifest.c +++ b/ext/smoothstreaming/gstmssmanifest.c @@ -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) {