From: Edward Hervey Date: Tue, 21 Nov 2017 14:33:57 +0000 (+0100) Subject: smoothstreaming: Handle invalid XML X-Git-Tag: 1.19.3~507^2~4733 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6e1e87d403e753b76d8b084ffd434ea98d5c7ef8;p=platform%2Fupstream%2Fgstreamer.git smoothstreaming: Handle invalid XML Nothing guarantees the manifest is valid and will return a root node --- diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c index 2085b36..c855cb3 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) {