diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 474c4d8658..ad00c65e25 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -161,6 +161,9 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream break; arraylen = avio_rb32(ioc); + if (arraylen >> 28) + break; + /* * Expect only 'times' or 'filepositions' sub-arrays in other case refuse to use such metadata * for indexing