avio_feof
authorMarkus Koschany <apo@debian.org>
Sun, 30 Dec 2018 11:12:16 +0000 (12:12 +0100)
committerSylvain Beucler <beuc@debian.org>
Thu, 5 Dec 2019 16:27:00 +0000 (16:27 +0000)
This function is needed for several of the CVE-2017-140xx flaws.

Gbp-Pq: Name avio_feof.patch

libavformat/avio.h
libavformat/aviobuf.c

index 3360e8296e85b76dd1bdc48309ee4c3fc0c087e5..76691320c2dcd59071c97f03cf0b74acd902b026 100644 (file)
@@ -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);
 
index 6923b78ea10888e65c5313f213430a0be967a0f1..17b83003b31e16e49b696fade1e48461a167643b 100644 (file)
@@ -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);