aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-06-20 01:36:29 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-10-21 22:19:37 +0200
commit2278ce503588fc13951625ba176428a2b42b63df (patch)
tree3b9ac4fb3baf0fd359f3bdf4e1eb26f6e6138d61
parentb0700a13140e0fb7008678ad65f5267019a22867 (diff)
downloadffmpeg-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.c2
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 == &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) {