diff options
author | Martin Storsjö <martin@martin.st> | 2010-06-08 11:06:36 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-06-08 11:06:36 +0000 |
commit | 4ceb8b3460d58617aff5deb9c73c43d04055542b (patch) | |
tree | 9421af061fd47f948af089df6c3f24309f0b12d3 /libavformat | |
parent | 5150dd532b142d7032854a362228dd40142a8e94 (diff) | |
download | ffmpeg-4ceb8b3460d58617aff5deb9c73c43d04055542b.tar.gz |
Fix bugs in the http custom header handling
Initialize the buffer av_strlcatf writes into.
Add the dash at the end of the Range header.
10l to me for not spotting it earlier
Originally committed as revision 23528 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/http.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/http.c b/libavformat/http.c index 0b4b57077a..09acee69ae 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -270,7 +270,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr, HTTPContext *s = h->priv_data; int post, err; char line[1024]; - char headers[1024]; + char headers[1024] = ""; char *authstr = NULL; int64_t off = s->off; int len = 0; @@ -290,7 +290,7 @@ static int http_connect(URLContext *h, const char *path, const char *hoststr, sizeof(headers) - len); if (!has_header(s->headers, "\r\nRange: ")) len += av_strlcatf(headers + len, sizeof(headers) - len, - "Range: bytes=%"PRId64"\r\n", s->off); + "Range: bytes=%"PRId64"-\r\n", s->off); if (!has_header(s->headers, "\r\nConnection: ")) len += av_strlcpy(headers + len, "Connection: close\r\n", sizeof(headers)-len); |