aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-09-12 22:05:24 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-09-19 00:43:22 +0200
commit6be3786c828edfd60d810c98a42a43eeac4f050c (patch)
tree2cc27125ba0ba5af42e9b1ecc3e99654d9d65085
parent5a96aa435af0d66bdec52ee115cf4dd971855fcd (diff)
downloadffmpeg-6be3786c828edfd60d810c98a42a43eeac4f050c.tar.gz
avformat/mxfdec: Check timecode for overflow
Fixes: signed integer overflow: 9223372036840103968 + 538976288 cannot be represented in type 'long' Fixes: 70604/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4844090340999168 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mxfdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 17a04e16f1..24f4ed1c33 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -2393,6 +2393,9 @@ static int mxf_parse_physical_source_package(MXFContext *mxf, MXFTrack *source_t
physical_track->edit_rate,
source_track->edit_rate);
+ if (av_sat_add64(start_position, mxf_tc->start_frame) != start_position + (uint64_t)mxf_tc->start_frame)
+ return AVERROR_INVALIDDATA;
+
if (av_timecode_init(&tc, mxf_tc->rate, flags, start_position + mxf_tc->start_frame, mxf->fc) == 0) {
mxf_add_timecode_metadata(&st->metadata, "timecode", &tc);
return 0;