[FFmpeg-devel] [PATCH 3/5] avcodec/vmdaudio: Fix channels count bug

Michael Niedermayer michael at niedermayer.cc
Mon Mar 21 22:19:44 EET 2022


Fixes: division by zero
Fixes: 45811/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMDAUDIO_fuzzer-6412592581574656

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/vmdaudio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.17.1



More information about the ffmpeg-devel mailing list