[FFmpeg-cvslog] avcodec/speexdec: Check channels > 2

Michael Niedermayer git at videolan.org
Thu Feb 23 23:19:57 EET 2023


ffmpeg | branch: release/5.1 | Michael Niedermayer <michael at niedermayer.cc> | Thu Sep 29 23:16:51 2022 +0200| [4b0d23902f7866ca9439f2fa90e9d83dd862ae6b] | committer: Michael Niedermayer

avcodec/speexdec: Check channels > 2

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 <michael at niedermayer.cc>
(cherry picked from commit 77164b2344eb67d61f973ebbbc8e0b88aaae027b)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4b0d23902f7866ca9439f2fa90e9d83dd862ae6b
---

 libavcodec/speexdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/speexdec.c b/libavcodec/speexdec.c
index 3251eda820..3e113df530 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) {



More information about the ffmpeg-cvslog mailing list