aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2015-10-21 11:56:36 +0300
committerMartin Storsjö <martin@martin.st>2015-10-23 10:31:55 +0300
commite02dcdf6bb6835ef4b49986b85a67efcb3495a7f (patch)
tree269dc240309d3fd2edcfb1ca080e5ac3729c1a5d
parentdca23ffbc7568c9af5c5fbaa86e6a0761ecae50c (diff)
downloadffmpeg-e02dcdf6bb6835ef4b49986b85a67efcb3495a7f.tar.gz
rtsp: Allow $ as interleaved packet indicator before a complete response header
Some RTSP servers ("HiIpcam/V100R003 VodServer/1.0.0") respond to our keepalive GET_PARAMETER request by a truncated RTSP header (lacking the final empty line to indicate a complete response header). Prior to 764ec70149, this worked just fine since we reacted to the $ as interleaved packet indicator anywhere. Since $ is a valid character within the response header lines, 764ec70149 changed it to be ignored there. But to keep compatibility with such broken servers, we need to at least allow reacting to it at the start of lines. Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavformat/rtsp.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index d2c99ea6f0..f62e370ae5 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1128,7 +1128,6 @@ 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:
@@ -1148,7 +1147,7 @@ start:
return AVERROR_EOF;
if (ch == '\n')
break;
- if (ch == '$' && first_line && q == buf) {
+ if (ch == '$' && q == buf) {
if (return_on_interleaved_data) {
return 1;
} else
@@ -1159,7 +1158,6 @@ start:
}
}
*q = '\0';
- first_line = 0;
av_log(s, AV_LOG_TRACE, "line='%s'\n", buf);