PR #23423 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23423
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23423.patch

Found-by: Forgejo Fairy
Signed-off-by: Michael Niedermayer <[email protected]>



>From 3f1e5ef93d55de22049eba6cc1cb1abcd9c8f958 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Fri, 5 Jun 2026 03:24:43 +0200
Subject: [PATCH] avcodec/misc4: Check nb channels

Found-by: Forgejo Fairy
Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavcodec/misc4.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/misc4.c b/libavcodec/misc4.c
index af075882f5..ac87ebd5cb 100644
--- a/libavcodec/misc4.c
+++ b/libavcodec/misc4.c
@@ -60,6 +60,9 @@ static av_cold int misc4_init(AVCodecContext *avctx)
     if (avctx->sample_rate <= 0)
         return AVERROR_INVALIDDATA;
 
+    if (avctx->ch_layout.nb_channels != 1 && avctx->ch_layout.nb_channels != 2)
+        return AVERROR_INVALIDDATA;
+
     avctx->sample_fmt = AV_SAMPLE_FMT_S16;
     switch (avctx->sample_rate) {
     case 8000:
-- 
2.52.0

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

Reply via email to