aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-06-20 01:36:29 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-07-22 17:15:48 +0200
commit5767941df88e75b2c2020e42580abc92478842e2 (patch)
treee2ea334f92d56768b08aff75974ff8e07c8e834d /libavformat
parente6584a3f19c0d6a6d4143c8d8a3d4fe9222d32aa (diff)
downloadffmpeg-5767941df88e75b2c2020e42580abc92478842e2.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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/flvdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index c5d3c63bd0..8dba92661b 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -463,6 +463,8 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, int64_t m
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) {