aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-09-12 22:29:04 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-09-19 00:39:21 +0200
commit5a96aa435af0d66bdec52ee115cf4dd971855fcd (patch)
tree8f4966d79a79f5cd0dc82665b69b4aa3f76c2a72
parent176db9db6e23f3299da379060adc89e4abc980b9 (diff)
downloadffmpeg-5a96aa435af0d66bdec52ee115cf4dd971855fcd.tar.gz
avformat/mxfdec: More offset_temp checks
Fixes: signed integer overflow: 9223372036854775807 - -1927491430256034080 cannot be represented in type 'long' Fixes: 70607/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5282235077951488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Tomas Härdin <git@haerdin.se> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mxfdec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 2a076931ed..17a04e16f1 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1921,6 +1921,11 @@ static int mxf_edit_unit_absolute_offset(MXFContext *mxf, MXFIndexTable *index_t
return mxf_absolute_bodysid_offset(mxf, index_table->body_sid, offset_temp, offset_out, partition_out);
} else {
/* EditUnitByteCount == 0 for VBR indexes, which is fine since they use explicit StreamOffsets */
+ if (s->edit_unit_byte_count && (s->index_duration > INT64_MAX / s->edit_unit_byte_count ||
+ s->edit_unit_byte_count * s->index_duration > INT64_MAX - offset_temp)
+ )
+ return AVERROR_INVALIDDATA;
+
offset_temp += s->edit_unit_byte_count * s->index_duration;
}
}