mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-08-09 09:32:43 +00:00
avformat/iamf_parse: check count_label against the available bytes
Fixes: unbounded allocation / denial of service Fixes: tP59h4cpaFyg Fixes:4ee05182b7(avformat: Immersive Audio Model and Formats demuxer) Found-by: Adrian Junge (vurlo) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit86708357d1) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -1009,6 +1009,11 @@ static int mix_presentation_obu(void *s, IAMFContext *c, AVIOContext *pb, int le
|
||||
mix_presentation->cmix = mix;
|
||||
|
||||
mix_presentation->count_label = ffio_read_leb(pbc);
|
||||
if (mix_presentation->count_label > len - avio_tell(pbc)) {
|
||||
mix_presentation->count_label = 0;
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
mix_presentation->language_label = av_calloc(mix_presentation->count_label,
|
||||
sizeof(*mix_presentation->language_label));
|
||||
if (!mix_presentation->language_label) {
|
||||
|
||||
Reference in New Issue
Block a user