diff options
-rw-r--r-- | libavformat/http.c | 3 |
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); } |