aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-24 23:50:23 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-06 11:30:43 +0100
commita3f6f2150649f7187e63136423c345b8ec532521 (patch)
tree385e58e34c2da1aab02e7861671841dfd85a4d06
parent18e5ce4d0d779d31858274d02851aa33ee831927 (diff)
downloadffmpeg-a3f6f2150649f7187e63136423c345b8ec532521.tar.gz
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 02fb6a214717d40487cae2b06f13b14fabb6e101) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/sbcdec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/sbcdec.c b/libavcodec/sbcdec.c
index 546b38c106..937946e2d2 100644
--- a/libavcodec/sbcdec.c
+++ b/libavcodec/sbcdec.c
@@ -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;