Commit 2570a877 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dsddec: Check channels

Fixes: division by zero
Fixes: 21677/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DSD_MSBF_fuzzer-5712547983654912
Fixes: 21751/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DSD_LSBF_fuzzer-5197097180856320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 620236e4
......@@ -44,6 +44,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
int i;
uint8_t silence;
if (!avctx->channels)
return AVERROR_INVALIDDATA;
ff_init_dsd_data();
s = av_malloc_array(sizeof(DSDContext), avctx->channels);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment