diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-30 16:23:09 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-30 16:24:03 +0200 |
commit | 8e67599505e3b0a968227a1dcd40020dff874001 (patch) | |
tree | 8abffea3b46bf926c6a1a190087e767c48aa4534 | |
parent | 77d8fd5c9c1d71b3995262dd737b248432ef5e3a (diff) | |
parent | 5ae178539b91d25710b7bb322d156c31aea9f8bf (diff) | |
download | ffmpeg-8e67599505e3b0a968227a1dcd40020dff874001.tar.gz |
Merge commit '5ae178539b91d25710b7bb322d156c31aea9f8bf'
* commit '5ae178539b91d25710b7bb322d156c31aea9f8bf':
http: Add the trailing endlines if they are missing
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/http.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c index 676bfd5c5a..684058147a 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -368,9 +368,16 @@ static int http_open(URLContext *h, const char *uri, int flags, if (s->headers) { int len = strlen(s->headers); - if (len < 2 || strcmp("\r\n", s->headers + len - 2)) + if (len < 2 || strcmp("\r\n", s->headers + len - 2)) { av_log(h, AV_LOG_WARNING, "No trailing CRLF found in HTTP header.\n"); + ret = av_reallocp(&s->headers, len + 3); + if (ret < 0) + return ret; + s->headers[len] = '\r'; + s->headers[len + 1] = '\n'; + s->headers[len + 2] = '\0'; + } } if (s->listen) { |