Module: libav Branch: release/11 Commit: 163b6a3ee326b8426ac7dc38d62e46b5aaf4ed09
Author: Martin Storsjö <[email protected]> Committer: Luca Barbato <[email protected]> Date: Wed Jan 21 13:05:43 2015 +0100 rtsp: Only interpret $ as interleaved packet indicator at the start of replies Allow $ as character anywhere within normal RTSP replies - both within the lines, and as the first character of RTSP header lines. (The existing old comment indicated that an inline packet could start at any line within a RTSP reply header, but that doesn't sound valid to me, and I'm not sure if the existing code handled that correctly either.) CC: [email protected] Signed-off-by: Martin Storsjö <[email protected]> --- libavformat/rtsp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 3d040d3..5bad163 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1083,6 +1083,7 @@ int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply, unsigned char ch; const char *p; int ret, content_length, line_count = 0, request = 0; + int first_line = 1; unsigned char *content = NULL; start: @@ -1102,8 +1103,7 @@ start: return AVERROR_EOF; if (ch == '\n') break; - if (ch == '$') { - /* XXX: only parse it if first char on line ? */ + if (ch == '$' && first_line && q == buf) { if (return_on_interleaved_data) { return 1; } else @@ -1114,6 +1114,7 @@ start: } } *q = '\0'; + first_line = 0; av_dlog(s, "line='%s'\n", buf); _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
