From e63e040f0cef2d6af2fb57aefa6250fc450fa049 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Fri, 22 Aug 2025 21:41:26 +0200 Subject: [PATCH] avformat/rtsp: fix leading space in RTSP reason When parsing the RTSP message reason, the whole remainder after parsing the status code was used, which would lead to a leading space in the parsed reason string. --- libavformat/rtsp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 13507d1858..d601d63a89 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1274,6 +1274,7 @@ start: if (!strncmp(buf1, "RTSP/", 5)) { get_word(buf1, sizeof(buf1), &p); reply->status_code = atoi(buf1); + p += strspn(p, SPACE_CHARS); av_strlcpy(reply->reason, p, sizeof(reply->reason)); } else { av_strlcpy(reply->reason, buf1, sizeof(reply->reason)); // method