From ad28e7975f457748341dc623288f00a8f601d6a7 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 6 Jan 2026 23:29:18 +0100 Subject: [PATCH] avformat/http: Check that the protocol of redirects is http or https Fixes: #YWH-PGM40646-10 Signed-off-by: Michael Niedermayer (cherry picked from commit b9227d49eabce4e54b2dedf60ec23a96d74ba16a) Signed-off-by: Michael Niedermayer --- libavformat/http.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/http.c b/libavformat/http.c index dde91b91e2..d9931cae36 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -233,7 +233,11 @@ static int http_open_cnx_internal(URLContext *h, AVDictionary **options) if (err < 0) goto end; } + } else if (strcmp(proto, "http")) { + err = AVERROR(EINVAL); + goto end; } + if (port < 0) port = 80;