aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-12-23 20:36:16 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-01-13 23:10:59 +0100
commitd3abd961eea8d33147c6477873ec8024abe8bc57 (patch)
tree49ae00d5d24adf81a62aeab52eb82f6f0a36e8ae /libavformat
parent357c339a84d2c340677bd5923b678221f227b36c (diff)
downloadffmpeg-d3abd961eea8d33147c6477873ec8024abe8bc57.tar.gz
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')
-rw-r--r--libavformat/flvdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 0a5c0e2d0a..229dbf14be 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -361,6 +361,8 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc,
d = av_int2double(avio_rb64(ioc));
if (isnan(d) || d < INT64_MIN || d > INT64_MAX)
goto invalid;
+ if (current_array == &times && (d <= INT64_MIN / 1000 || d >= INT64_MAX / 1000))
+ goto invalid;
current_array[0][i] = d;
}
if (times && filepositions) {