diff mbox series

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

Message ID 20220702122250.23065-1-michael@niedermayer.cc
State Accepted
Commit 9fec43a92d7304fc594dcf73c6dd3144b855617d
Headers show
Series [FFmpeg-devel,1/3] avcodec/alsdec: No channels cannot be accessed | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Michael Niedermayer July 2, 2022, 12:22 p.m. UTC
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@niedermayer.cc>
---
 libavcodec/alsdec.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thilo Borgmann July 2, 2022, 1:27 p.m. UTC | #1
Am 02.07.22 um 14:22 schrieb Michael Niedermayer:
> 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@niedermayer.cc>
> ---
>   libavcodec/alsdec.c | 3 +++
>   1 file changed, 3 insertions(+)

LGTM

Thanks,
Thilo
Michael Niedermayer July 3, 2022, 5:11 p.m. UTC | #2
On Sat, Jul 02, 2022 at 03:27:03PM +0200, Thilo Borgmann wrote:
> Am 02.07.22 um 14:22 schrieb Michael Niedermayer:
> > 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@niedermayer.cc>
> > ---
> >   libavcodec/alsdec.c | 3 +++
> >   1 file changed, 3 insertions(+)
> 
> LGTM

will apply

thx

[...]
diff mbox series

Patch

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