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

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 3e09f5e24e avcodec/cook: require the channel mask to cover every 
subpacket channel
3e09f5e24e is described below

commit 3e09f5e24eb277a6d011745ff03e602f61c5c171
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Mon Sep 14 02:27:37 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Wed Sep 16 21:16:58 2026 +0000

    avcodec/cook: require the channel mask to cover every subpacket channel
    
    Fixes: 2MzQLLrSXH8j
    Fixes: out of array write
    Found-by: Zheng Yu @ Depthfirst
---
 libavcodec/cook.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 8256afc2e4..5ed3d2596b 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -1249,6 +1249,12 @@ static av_cold int cook_decode_init(AVCodecContext 
*avctx)
         s++;
     }
 
+    if (channel_mask && av_popcount(channel_mask) != total_channels) {
+        av_log(avctx, AV_LOG_ERROR, "Channel mask 0x%x does not match %d 
subpacket channels\n",
+               channel_mask, total_channels);
+        return AVERROR_INVALIDDATA;
+    }
+
     /* Try to catch some obviously faulty streams, otherwise it might be 
exploitable */
     if (q->samples_per_channel != 256 && q->samples_per_channel != 512 &&
         q->samples_per_channel != 1024) {

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to