Message ID | 20240717112745.1624968-2-michael@niedermayer.cc |
---|---|
State | New |
Headers | show |
Series | [FFmpeg-devel,1/5] avutil/timecode: Use a 64bit framenum internally | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
ons 2024-07-17 klockan 13:27 +0200 skrev Michael Niedermayer: > 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 <michael@niedermayer.cc> > --- > libavformat/mxfdec.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c > index a5863445ab5..af0c8a31007 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; Should be OK since b is always >= 0. /Tomas
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index a5863445ab5..af0c8a31007 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;
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 <michael@niedermayer.cc> --- libavformat/mxfdec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)