diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-12-23 22:36:16 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-04-07 17:27:00 +0300 |
commit | f8bbc2ced33669cbd70428b5ecca2536dff9eb16 (patch) | |
tree | 2328bcad290db0ac3dd7768b1106043b2afae27f /libavformat/flvdec.c | |
parent | c202ffefaa55087dc1e7d995861fe71f63a814c5 (diff) |
avformat/flvdec: timestamps cannot use the full int64 range
We do not support this as we multiply by 1000
Fixes: signed integer overflow: -45318575073853696 * 1000 cannot be represented in type 'long'
Fixes: 42804/clusterfuzz-testcase-minimized-ffmpeg_dem_LIVE_FLV_fuzzer-4630325425209344
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 c217ca7718c8e24905d7ba9ede719ae040899476)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/flvdec.c')
-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 3ccb89475e..ce706da03c 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -460,6 +460,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) { |