diff --git a/libavformat/mov.c b/libavformat/mov.c index f8248ab65b..3ec0ea2361 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -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);