avcodec/misc4: Check nb channels

Found-by: Forgejo Fairy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7b717fe50d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer committed 2026-06-14 04:59:13 +02:00
1 parent 8fae91a6ab
commit c8d3eb40f9
1 file changed
+3
+3
View File
@@ -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: