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.
This commit is contained in:
Marvin Scholz
2025-08-22 21:41:26 +02:00
parent 2ed47ab725
commit e63e040f0c

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