diff options
author | Guillaume Desmottes <guillaume.desmottes@onestream.live> | 2023-04-11 17:54:23 +0200 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2023-04-14 05:17:16 +0000 |
commit | a921e40228a2190715b6ba2b1fb4a4b6deb7ede9 (patch) | |
tree | 9c2c26a18cc44a90eb77b492377068d0e25e8c19 | |
parent | f4aeac45e52b7ef651e770f944c4f4b333965807 (diff) | |
download | gstreamer-a921e40228a2190715b6ba2b1fb4a4b6deb7ede9.tar.gz |
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4421>
-rw-r--r-- | subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c index 817348d294..8e7c0809cb 100644 --- a/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c +++ b/subprojects/gst-plugins-good/ext/adaptivedemux2/gstadaptivedemux.c @@ -953,6 +953,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."); } |