diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-06-20 01:36:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-09-26 16:50:51 +0200 |
commit | 0edd5feafa190adc57066aa9b82cdf90170b7ddb (patch) | |
tree | 4ca2daaeb893521a310ee148adcc31e579b19ecc | |
parent | b60d9730cf99653215acd42dc7d3b7ae17655ab9 (diff) | |
download | ffmpeg-0edd5feafa190adc57066aa9b82cdf90170b7ddb.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 1d10db9278..df4842d847 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -461,6 +461,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) { |