libavformat/http: return EIO when ffurl_read return 0, but s->off < target_end
authorraymondzheng <raymondzheng1412@gmail.com>
Thu, 18 May 2017 06:35:31 +0000 (14:35 +0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 9 Jun 2017 11:27:44 +0000 (13:27 +0200)
Approved-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/http.c

index d06103a..30890bb 100644 (file)
@@ -1326,7 +1326,7 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
     }
     if (len > 0) {
         s->off += len;
     }
     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;
         }
             av_assert0(s->chunksize >= len);
             s->chunksize -= len;
         }