From: Michael Niedermayer Date: Sat, 28 Mar 2015 23:33:35 +0000 (+0100) Subject: avformat/http: Return an error in case of prematurely ending data X-Git-Tag: archive/raspbian/6%11.12-1_deb8u6+rpi1^2~32 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ed0922f4b1013602dca79f022449f0c6a93def4c;p=libav.git avformat/http: Return an error in case of prematurely ending data Fixes Ticket 4039 Signed-off-by: Michael Niedermayer Gbp-Pq: Name CVE-2016-10190-pre1-3668701f.patch --- diff --git a/libavformat/http.c b/libavformat/http.c index 06ab599..6755583 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -707,6 +707,14 @@ static int http_buf_read(URLContext *h, uint8_t *buf, int size) s->filesize >= 0 && s->off >= s->filesize) return AVERROR_EOF; len = ffurl_read(s->hd, buf, size); + if (!len && (!s->willclose || s->chunksize < 0) && + s->filesize >= 0 && s->off < s->filesize) { + av_log(h, AV_LOG_ERROR, + "Streams ends prematurly at %"PRId64", should be %"PRId64"\n", + s->off, s->filesize + ); + return AVERROR(EIO); + } } if (len > 0) { s->off += len;