avformat/mov: Non overflowing ambisonic order check

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>
This commit is contained in:
Michael Niedermayer 2022-03-25 22:47:26 +01:00
parent 9874baf2cd
commit 9274fb2532
1 changed files with 1 additions and 1 deletions

View File

@ -7381,7 +7381,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);