mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 10:04:37 +08:00
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:
1 file changed
+3
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user