]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/http.c
tools/enum_options: fix build and add to Makefile
[ffmpeg] / libavformat / http.c
index 3d25d652d3196a2300271928b894fbddb96b0baf..2d24c00e183d4eb0e54c0d8e95afbe43f9d1d2db 100644 (file)
@@ -1436,7 +1436,8 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
         if ((!s->willclose || s->chunksize == UINT64_MAX) && s->off >= target_end)
             return AVERROR_EOF;
         len = ffurl_read(s->hd, buf, size);
-        if (!len && (!s->willclose || s->chunksize == UINT64_MAX) && s->off < target_end) {
+        if ((!len || len == AVERROR_EOF) &&
+            (!s->willclose || s->chunksize == UINT64_MAX) && s->off < target_end) {
             av_log(h, AV_LOG_ERROR,
                    "Stream ends prematurely at %"PRIu64", should be %"PRIu64"\n",
                    s->off, target_end