summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2024-07-16 21:31:21 +0200
committerMichael Niedermayer <[email protected]>2024-07-21 15:29:25 +0200
commitd8d288479d3431d65318d957aab710b13714fc05 (patch)
tree4008eae7b4b477f8c2e0bb269df0022aedab7c28
parentd5ca373d7efa37d2d3911f0afbc85fad0dc86b38 (diff)
avformat/mxfdec: Reorder elements of expression in bisect loop
Fixes: signed integer overflow: 9223372036854775807 - -1 cannot be represented in type 'long' Fixes: 68578/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6032171648221184 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/mxfdec.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index a5863445ab..af0c8a3100 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -3821,8 +3821,7 @@ static int mxf_get_next_track_edit_unit(MXFContext *mxf, MXFTrack *track, int64_
a = -1;
b = track->original_duration;
-
- while (b - a > 1) {
+ while (b - 1 > a) {
m = (a + b) >> 1;
if (mxf_edit_unit_absolute_offset(mxf, t, m, track->edit_rate, NULL, &offset, NULL, 0) < 0)
return -1;