hls: Avoid potential NULL pointer dereference.
authorJan Schmidt <jan@centricular.com>
Thu, 4 Aug 2016 12:28:13 +0000 (22:28 +1000)
committerJan Schmidt <jan@centricular.com>
Thu, 4 Aug 2016 12:28:13 +0000 (22:28 +1000)
Fixes CID 1364753

ext/hls/gsthlsdemux.c

index 8824931..4cf5b81 100644 (file)
@@ -596,8 +596,10 @@ gst_hls_demux_process_manifest (GstAdaptiveDemux * demux, GstBuffer * buf)
         NULL, demux->connection_speed);
   }
 
-  GST_INFO_OBJECT (hlsdemux, "selected %s", variant->name);
-  gst_hls_demux_set_current_variant (hlsdemux, variant);        // FIXME: inline?
+  if (variant) {
+    GST_INFO_OBJECT (hlsdemux, "selected %s", variant->name);
+    gst_hls_demux_set_current_variant (hlsdemux, variant);      // FIXME: inline?
+  }
 
   /* get the selected media playlist (unless the inital list was one already) */
   if (!hlsdemux->master->is_simple) {