summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-13 18:26:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-13 18:26:40 +0200
commit9f7a2ecb29264388f3997dcd34647a55cfa22253 (patch)
treef98717f96ac5501c3ed636032f675a28e0ee4e98 /libavformat/http.c
parenta539f1cbbd8f32a5a3875a4d194c418077e3b6d8 (diff)
parent8bf3bf69ad7333bf0c45f4d2797fc2c61bc8922f (diff)
Merge commit '8bf3bf69ad7333bf0c45f4d2797fc2c61bc8922f'
* commit '8bf3bf69ad7333bf0c45f4d2797fc2c61bc8922f': http: Stop reading after receiving the whole file for non-chunked transfers Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 18fd9e038d..a9f1700f2d 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -841,7 +841,8 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
memcpy(buf, s->buf_ptr, len);
s->buf_ptr += len;
} else {
- if (!s->willclose && s->filesize >= 0 && s->off >= s->filesize)
+ if ((!s->willclose || s->chunksize < 0) &&
+ s->filesize >= 0 && s->off >= s->filesize)
return AVERROR_EOF;
len = ffurl_read(s->hd, buf, size);
}