From 985af9906bdb4c7d4cbd9ad9bc34eead3c5a6994 Mon Sep 17 00:00:00 2001
From: raymondzheng <raymondzheng1412@gmail.com>
Date: Thu, 18 May 2017 14:35:31 +0800
Subject: [PATCH] libavformat/http: return EIO when ffurl_read return 0, but
 s->off < target_end

---
 libavformat/http.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index d06103ab6d..30890bb7aa 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -1326,7 +1326,7 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
     }
     if (len > 0) {
         s->off += len;
-        if (s->chunksize > 0) {
+        if (s->chunksize > 0 && s->chunksize != UINT64_MAX) {
             av_assert0(s->chunksize >= len);
             s->chunksize -= len;
         }
-- 
2.11.0 (Apple Git-81)

