diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 44a7e5f93c..b9e36b3ff1 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 d = av_int2double(avio_rb64(ioc)); if (isnan(d) || d < INT64_MIN || d > INT64_MAX) goto invalid; + if (current_array == × && (d <= INT64_MIN / 1000 || d >= INT64_MAX / 1000)) + goto invalid; current_array[0][i] = d; } if (times && filepositions) {