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.

(cherry picked from commit e63e040f0c)
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
This commit is contained in:
Marvin Scholz
2025-08-22 21:41:26 +02:00
parent 1e56c51d3b
commit d1f31a829d

View File

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