Fixes: signed integer overflow: 4611686016549392399 + 9223372033098784800 cannot be represented in type 'long long' Fixes: 368503277/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5928227458056192
Showing the changes to libavformat (1 of 1 file). Show all
Unified · Split
| @@ -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) |