This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/7.1
in repository ffmpeg.

commit 40b336e65043cbde6136ed338a18e3941dd0e6da
Author:     James Almer <[email protected]>
AuthorDate: Sat Dec 27 19:11:07 2025 -0300
Commit:     James Almer <[email protected]>
CommitDate: Tue Dec 30 20:25:18 2025 -0300

    avformat/iamf_writer: check that stream count is consistent for ambisonic 
Audio Elements
    
    Signed-off-by: James Almer <[email protected]>
    (cherry picked from commit a0fc454871c116d5bd1bbec5138dfe3ffcb1f11d)
---
 libavformat/iamf_writer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/iamf_writer.c b/libavformat/iamf_writer.c
index d13bd8fecc..61d69373d9 100644
--- a/libavformat/iamf_writer.c
+++ b/libavformat/iamf_writer.c
@@ -583,8 +583,12 @@ static int ambisonics_config(const IAMFAudioElement 
*audio_element,
                              AVIOContext *dyn_bc)
 {
     const AVIAMFAudioElement *element = audio_element->celement;
+    const IAMFLayer *ilayer = &audio_element->layers[0];
     const AVIAMFLayer *layer = element->layers[0];
 
+    if (audio_element->nb_substreams != ilayer->substream_count)
+        return AVERROR(EINVAL);
+
     ffio_write_leb(dyn_bc, 0); // ambisonics_mode
     avio_w8(dyn_bc, layer->ch_layout.nb_channels); // output_channel_count
     avio_w8(dyn_bc, audio_element->nb_substreams); // substream_count

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to