diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-06-20 01:36:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-10-21 22:19:37 +0200 |
commit | 2278ce503588fc13951625ba176428a2b42b63df (patch) | |
tree | 3b9ac4fb3baf0fd359f3bdf4e1eb26f6e6138d61 | |
parent | b0700a13140e0fb7008678ad65f5267019a22867 (diff) | |
download | ffmpeg-2278ce503588fc13951625ba176428a2b42b63df.tar.gz |
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@niedermayer.cc>
(cherry picked from commit ceff5d7b74cd9ae6055957979d27d289c70a9e1b)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/flvdec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index b61ac7f973..378cb6bc94 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -424,6 +424,8 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, int64_t m goto invalid; if (current_array == × && (d <= INT64_MIN / 1000 || d >= INT64_MAX / 1000)) goto invalid; + if (avio_feof(ioc)) + goto invalid; current_array[0][i] = d; } if (times && filepositions) { |