[FFmpeg-cvslog] avformat/flvdec: Check for EOF in index reading

Michael Niedermayer git at videolan.org
Fri Oct 28 22:17:06 EEST 2022


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Mon Jun 20 01:36:29 2022 +0200| [e6f9ae27ca97fc3e5a72d26aac31815eb04f993f] | committer: Michael Niedermayer

avformat/flvdec: Check for EOF in index reading

Fixes: Timeout
Fixes: 47992/clusterfuzz-testcase-minimized-ffmpeg_dem_LIVE_FLV_fuzzer-6020443879899136

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit ceff5d7b74cd9ae6055957979d27d289c70a9e1b)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e6f9ae27ca97fc3e5a72d26aac31815eb04f993f
---

 libavformat/flvdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 229dbf14be..e5bf82567d 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -363,6 +363,8 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc,
                 goto invalid;
             if (current_array == &times && (d <= INT64_MIN / 1000 || d >= INT64_MAX / 1000))
                 goto invalid;
+            if (avio_feof(ioc))
+                goto invalid;
             current_array[0][i] = d;
         }
         if (times && filepositions) {



More information about the ffmpeg-cvslog mailing list