From ea9e85e54981b8402368d0f21648836d6738f1b1 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 27 Feb 2026 23:39:28 +0100 Subject: [PATCH] avformat/rtsp: Explicitly check protocol Fixes: redirect to non rtsp protocol Fixes: YWH-PGM40646-41 Found-by: BapToutatis Signed-off-by: Michael Niedermayer --- libavformat/rtsp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index edb3142b3c..6da03d26fe 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1919,7 +1919,8 @@ redirect: } else if (!strcmp(proto, "satip")) { av_strlcpy(proto, "rtsp", sizeof(proto)); rt->server_type = RTSP_SERVER_SATIP; - } + } else if (strcmp(proto, "rtsp")) + return AVERROR_INVALIDDATA; if (*auth) { av_strlcpy(rt->auth, auth, sizeof(rt->auth));