Browse Source

avcodec/sbcdec: Initialize number of channels

Fixes: out of array access
Fixes: 17609/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SBC_fuzzer-5758729319874560

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 02fb6a2147)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.2.2
Michael Niedermayer 6 years ago
parent
commit
c0f315b835
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavcodec/sbcdec.c

+ 1
- 0
libavcodec/sbcdec.c View File

@@ -348,6 +348,7 @@ static int sbc_decode_frame(AVCodecContext *avctx,
if (frame_length <= 0)
return frame_length;

avctx->channels =
frame->channels = sbc->frame.channels;
frame->format = AV_SAMPLE_FMT_S16P;
frame->nb_samples = sbc->frame.blocks * sbc->frame.subbands;


Loading…
Cancel
Save