mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
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>
(cherry picked from commit 5a96aa435a
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
3cdb0aa5a0
commit
95777d2e5f
@ -1337,6 +1337,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);
|
||||
} 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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user