summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <edward@centricular.com>2017-11-21 15:33:57 +0100
committerEdward Hervey <bilboed@bilboed.com>2017-12-01 10:51:16 +0100
commit865de199f159df4a04d09f36e35f2e4520da4375 (patch)
treea91d46ca038d7550c08273f0f8378602c579416a
parent2707d5cfa6856762615e88fd7c66137b2574f60e (diff)
downloadgstreamer-plugins-bad-865de199f159df4a04d09f36e35f2e4520da4375.tar.gz
smoothstreaming: Handle invalid XML
Nothing guarantees the manifest is valid and will return a root node
-rw-r--r--ext/smoothstreaming/gstmssmanifest.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c
index fb1eb0df8..2370c7206 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) {