summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-07-02 14:22:48 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2022-07-03 19:36:26 +0200
commit9fec43a92d7304fc594dcf73c6dd3144b855617d (patch)
tree69162bb5bb65460abb9c7858e1570f411f4c989e
parentcd847f86d31f87f0f7733ca6ab7a2c022a1398bd (diff)
avcodec/alsdec: No channels cannot be accessed
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 Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/alsdec.c3
1 files changed, 3 insertions, 0 deletions
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