Message ID | 20220325230650.29751-1-michael@niedermayer.cc |
---|---|
State | Accepted |
Commit | 9274fb25324cc7676d3464b5248739166926c6a7 |
Headers | show |
Series | [FFmpeg-devel,1/2] avformat/mov: Non overflowing ambisonic order check | expand |
Context | Check | Description |
---|---|---|
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
On Sat, Mar 26, 2022 at 12:06:49AM +0100, Michael Niedermayer wrote: > Fixes: signed integer overflow: 536870913 * 536870913 cannot be represented in type 'int' > Fixes: 45862/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4730373768085504 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> > --- > libavformat/mov.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) will apply [...]
diff --git a/libavformat/mov.c b/libavformat/mov.c index 6c847de164..3619be68f4 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -7382,7 +7382,7 @@ static int mov_read_SA3D(MOVContext *c, AVIOContext *pb, MOVAtom atom) } channel_count = avio_rb32(pb); - if (channel_count != (ambisonic_order + 1) * (ambisonic_order + 1)) { + if (ambisonic_order < 0 || channel_count != (ambisonic_order + 1LL) * (ambisonic_order + 1LL)) { av_log(c->fc, AV_LOG_ERROR, "Invalid number of channels (%d / %d)\n", channel_count, ambisonic_order);
Fixes: signed integer overflow: 536870913 * 536870913 cannot be represented in type 'int' Fixes: 45862/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-4730373768085504 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)