avformat/http: Check that the protocol of redirects is http or https

Fixes: #YWH-PGM40646-10

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b9227d49ea)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2026-01-06 23:29:18 +01:00
parent 1cd5e7ef49
commit ad28e7975f
No known key found for this signature in database
GPG key ID: B18E8928B3948D64

View file

@ -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;