From: Markus Koschany Date: Sun, 30 Dec 2018 11:12:16 +0000 (+0100) Subject: avio_feof X-Git-Tag: archive/raspbian/6%11.12-1_deb8u5+rpi1^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a5e3c3aad688278d7233ed787430b0e7b3687119;p=libav.git avio_feof This function is needed for several of the CVE-2017-140xx flaws. Gbp-Pq: Name avio_feof.patch --- diff --git a/libavformat/avio.h b/libavformat/avio.h index 3360e82..7669132 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -227,6 +227,8 @@ static av_always_inline int64_t avio_tell(AVIOContext *s) */ int64_t avio_size(AVIOContext *s); +int avio_feof(AVIOContext *s); + /** @warning currently size is limited */ int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3); diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 6923b78..17b8300 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -257,6 +257,17 @@ int64_t avio_size(AVIOContext *s) return size; } +int avio_feof(AVIOContext *s) +{ + if(!s) + return 0; + if(s->eof_reached){ + s->eof_reached=0; + fill_buffer(s); + } + return s->eof_reached; +} + void avio_wl32(AVIOContext *s, unsigned int val) { avio_w8(s, val);