aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-09-18 16:35:41 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-26 16:51:02 +0200
commit964fb9f59f1054052875389c73bec3278d9c2519 (patch)
tree522ad9978ff0f50f0e997e8c2c05b15c4b6ebf16
parentf24aa3a531d6aabd2a333830d8e4d448f18c1ddf (diff)
downloadffmpeg-964fb9f59f1054052875389c73bec3278d9c2519.tar.gz
avformat/sbgdec: Check ts_int in genrate_intervals
There is probably a better place to check for this, but better here than nowhere Fixes: signed integer overflow: -9223372036824775808 - 86400000000 cannot be represented in type 'long' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_SBG_fuzzer-6601162580688896 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 5f529e9147a5c5c8ecf8d5ef0dd569194ce30eed) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/sbgdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c
index 5bc914169b..e2cac9132a 100644
--- a/libavformat/sbgdec.c
+++ b/libavformat/sbgdec.c
@@ -1314,6 +1314,8 @@ static int generate_intervals(void *log, struct sbg_script *s, int sample_rate,
/* Pseudo event before the first one */
ev0 = s->events[s->nb_events - 1];
+ if (av_sat_sub64(ev0.ts_int, period) != (uint64_t)ev0.ts_int - period)
+ return AVERROR_INVALIDDATA;
ev0.ts_int -= period;
ev0.ts_trans -= period;
ev0.ts_next -= period;