avformat/iamf_parse: reject ambisonics mode > 1

ambisonics mode > 1 does not initialize any layer but layer 0
is unconditionally dereferenced

Fixes: poc-2024-11
Fixes: null pointer dereference
Found-by: 苏童 <220235212@seu.edu.cn>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-11-29 02:28:18 +01:00
parent 1c2c70fe4d
commit 4cc1495aca
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -413,7 +413,7 @@ static int ambisonics_config(void *s, AVIOContext *pb,
ambisonics_mode = ffio_read_leb(pb);
if (ambisonics_mode > 1)
return 0;
return AVERROR_INVALIDDATA;
output_channel_count = avio_r8(pb); // C
substream_count = avio_r8(pb); // N