summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-03-21 20:30:29 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-03-28 19:56:12 +0200
commit31b22defcd8c6f0c95ef3be1ea819adf536ad8cb (patch)
treeba1471c4eea980db4c9ec733abc79a45630ca65f
parent5ee198f9aae40681de2735260465d47c64b53feb (diff)
avcodec/vmdaudio: Fix channels count bug
Fixes: division by zero Fixes: 45811/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMDAUDIO_fuzzer-6412592581574656 Fixes: 45979/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMDAUDIO_fuzzer-5362043060879360 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/vmdaudio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vmdaudio.c b/libavcodec/vmdaudio.c
index 045a2da410..875930061a 100644
--- a/libavcodec/vmdaudio.c
+++ b/libavcodec/vmdaudio.c
@@ -85,7 +85,7 @@ static av_cold int vmdaudio_decode_init(AVCodecContext *avctx)
}
av_channel_layout_uninit(&avctx->ch_layout);
- av_channel_layout_default(&avctx->ch_layout, channels == 1);
+ av_channel_layout_default(&avctx->ch_layout, channels);
if (avctx->bits_per_coded_sample == 16)
avctx->sample_fmt = AV_SAMPLE_FMT_S16;