More than 2 channels seems unsupported, the code seems to just output empty 
extra channels

Fixes: Timeout
Fixes: 
51569/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SPEEX_fuzzer-5511509165342720

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

diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
index 9793d939fcb..08c7e77e7d5 100644
--- a/libavcodec/speexdec.c
+++ b/libavcodec/speexdec.c
@@ -1452,7 +1452,7 @@ static av_cold int speex_decode_init(AVCodecContext 
*avctx)
             return AVERROR_INVALIDDATA;
 
         s->nb_channels = avctx->ch_layout.nb_channels;
-        if (s->nb_channels <= 0)
+        if (s->nb_channels <= 0 || s->nb_channels > 2)
             return AVERROR_INVALIDDATA;
 
         switch (s->rate) {
-- 
2.17.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to