From: Rodger Combs Date: Sun, 18 Oct 2015 22:50:21 +0000 (-0500) Subject: lavf/http: fix incorrect warning in range requests X-Git-Tag: archive/raspbian/6%11.12-1_deb8u7+rpi1^2~33 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=783b4866683eac5dc24db1f7bc6c13afc51b765c;p=libav.git lavf/http: fix incorrect warning in range requests Gbp-Pq: Name CVE-2016-10190-pre2-362c17e6.patch --- diff --git a/libavformat/http.c b/libavformat/http.c index 6755583..f445e83 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -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); }