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;