[FFmpeg-devel] [PATCH 1/3] avcodec/alsdec: No channels cannot be accessed

Michael Niedermayer michael at niedermayer.cc
Sat Jul 2 15:22:48 EEST 2022


Fixes: out of array access
Fixes: 48145/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5054524173189120

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/alsdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index bf961a03f5..7031fa0acb 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -361,6 +361,9 @@ static av_cold int read_specific_config(ALSDecContext *ctx)
         return AVERROR_PATCHWELCOME;
     }
 
+    if (avctx->ch_layout.nb_channels == 0)
+        return AVERROR_INVALIDDATA;
+
     ctx->cur_frame_length = sconf->frame_length;
 
     // read channel config
-- 
2.17.1



More information about the ffmpeg-devel mailing list