lavf/http: fix incorrect warning in range requests
authorRodger Combs <rodger.combs@gmail.com>
Sun, 18 Oct 2015 22:50:21 +0000 (17:50 -0500)
committerMike Gabriel <sunweaver@debian.org>
Thu, 20 Dec 2018 21:56:40 +0000 (21:56 +0000)
Gbp-Pq: Name CVE-2016-10190-pre2-362c17e6.patch

libavformat/http.c

index 6755583d2b0b90c28352b8ed2a8ced4cc7f9db5b..f445e83cc0310ebcb4748a361f3f10e75d84868c 100644 (file)
@@ -703,15 +703,16 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size)
         memcpy(buf, s->buf_ptr, len);
         s->buf_ptr += len;
     } else {
+        int64_t target_end = s->end_off ? s->end_off : s->filesize;
         if ((!s->willclose || s->chunksize < 0) &&
-            s->filesize >= 0 && s->off >= s->filesize)
+            target_end >= 0 && s->off >= target_end)
             return AVERROR_EOF;
         len = ffurl_read(s->hd, buf, size);
         if (!len && (!s->willclose || s->chunksize < 0) &&
-            s->filesize >= 0 && s->off < s->filesize) {
+            target_end >= 0 && s->off < target_end) {
             av_log(h, AV_LOG_ERROR,
                    "Streams ends prematurly at %"PRId64", should be %"PRId64"\n",
-                   s->off, s->filesize
+                   s->off, target_end
                   );
             return AVERROR(EIO);
         }