forked from jengelh/ffmpeg-7
34 lines
1.2 KiB
Diff
34 lines
1.2 KiB
Diff
From 0526535cd58444dd264e810b2f3348b4d96cff3b Mon Sep 17 00:00:00 2001
|
|
From: James Almer <jamrial@gmail.com>
|
|
Date: Mon, 17 Feb 2025 11:41:24 -0300
|
|
Subject: [PATCH] avformat/iamf_parse: add missing constrains for
|
|
num_parameters in audio_element_oub()
|
|
|
|
Fixes ticket #11475.
|
|
|
|
Signed-off-by: James Almer <jamrial@gmail.com>
|
|
---
|
|
libavformat/iamf_parse.c | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/libavformat/iamf_parse.c b/libavformat/iamf_parse.c
|
|
index 316093b35f..f71ea5315b 100644
|
|
--- a/libavformat/iamf_parse.c
|
|
+++ b/libavformat/iamf_parse.c
|
|
@@ -733,6 +733,12 @@ static int audio_element_obu(void *s, IAMFContext *c, AVIOContext *pb, int len)
|
|
}
|
|
|
|
num_parameters = ffio_read_leb(pbc);
|
|
+ if (num_parameters > 2 && audio_element_type == 0) {
|
|
+ av_log(s, AV_LOG_ERROR, "Audio Element parameter count %u is invalid"
|
|
+ " for Channel representations\n", num_parameters);
|
|
+ ret = AVERROR_INVALIDDATA;
|
|
+ goto fail;
|
|
+ }
|
|
if (num_parameters && audio_element_type != 0) {
|
|
av_log(s, AV_LOG_ERROR, "Audio Element parameter count %u is invalid"
|
|
" for Scene representations\n", num_parameters);
|
|
--
|
|
2.41.0
|
|
|