From df3b2e2d41067baf8d305fff5cbe0d3d7b32a939 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Tue, 11 Apr 2023 17:54:23 +0200 Subject: [PATCH] adaptivedemux2: fix critical when using an unsupported URI adaptivedemux2 only supports http(s), trying to use it with, say, file:// was raising a CRITICAL in libsoup. Fix #2476 Part-of: --- .../ext/adaptivedemux2/gstadaptivedemux.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c index 51ba8bd321..2104486f6a 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c @@ -990,6 +990,15 @@ handle_incoming_manifest (GstAdaptiveDemux * demux) GST_DEBUG_OBJECT (demux, "Fetched manifest at URI: %s (base: %s)", demux->manifest_uri, GST_STR_NULL (demux->manifest_base_uri)); + + if (!g_str_has_prefix (demux->manifest_uri, "http://") + && !g_str_has_prefix (demux->manifest_uri, "https://")) { + GST_ELEMENT_ERROR (demux, STREAM, DEMUX, + (_("Invalid manifest URI")), + ("Manifest URI needs to use either http:// or https://")); + ret = FALSE; + goto unlock_out; + } } else { GST_WARNING_OBJECT (demux, "Upstream URI query failed."); }