diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 9e254c710d..f77dca1895 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -3312,8 +3312,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;