Skip to content

Commit b06845c

Browse files
committed
avformat/iamf_parse: add missing constrains for num_parameters in audio_element_oub()
Fixes ticket #11475. Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 0526535)
1 parent 04fd3f6 commit b06845c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libavformat/iamf_parse.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,12 @@ static int audio_element_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
728728
}
729729

730730
num_parameters = ffio_read_leb(pbc);
731+
if (num_parameters > 2 && audio_element_type == 0) {
732+
av_log(s, AV_LOG_ERROR, "Audio Element parameter count %u is invalid"
733+
" for Channel representations\n", num_parameters);
734+
ret = AVERROR_INVALIDDATA;
735+
goto fail;
736+
}
731737
if (num_parameters && audio_element_type != 0) {
732738
av_log(s, AV_LOG_ERROR, "Audio Element parameter count %u is invalid"
733739
" for Scene representations\n", num_parameters);

0 commit comments

Comments
 (0)