History

avformat/mxfdec: Fix overflow in midpoint computation

Fixes: signed integer overflow: 4611686016549392399 + 9223372033098784800 cannot be represented in type 'long long' Fixes: 368503277/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5928227458056192

Michael Niedermayer committed 2 years ago

Commit 23088a51 parent 3fe30141 file · +1 −1Browse files

Showing the changes to libavformat (1 of 1 file). Show all

Unified · Split

libavformat/mxfdec.c+1−1
@@ -3896,7 +3896,7 @@ static int mxf_get_next_track_edit_unit(MXFContext *mxf, MXFTrack *track, int64_ · 3895 unmodified lines
3896 a = -1;3896 a = -1;
3897 b = track->original_duration;3897 b = track->original_duration;
3898 while (b - 1 > a) {3898 while (b - 1 > a) {
3899 m = (a + b) >> 1;3899 m = (a + (uint64_t)b) >> 1;
3900 if (mxf_edit_unit_absolute_offset(mxf, t, m, track->edit_rate, NULL, &offset, NULL, 0) < 0)3900 if (mxf_edit_unit_absolute_offset(mxf, t, m, track->edit_rate, NULL, &offset, NULL, 0) < 0)
3901 return -1;3901 return -1;
3902 if (offset < current_offset)3902 if (offset < current_offset)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t