diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-05-04 00:04:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-05-21 09:31:08 +0200 |
commit | 2570a8777e7095358b10f679d35641e114a2ab33 (patch) | |
tree | 6ee7193775a44e25caa7b251dd11afc8948336ad /libavcodec/dsddec.c | |
parent | 620236e4d2ac46821911b99fa4551868675d4ed9 (diff) | |
download | ffmpeg-2570a8777e7095358b10f679d35641e114a2ab33.tar.gz |
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/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/dsddec.c')
-rw-r--r-- | libavcodec/dsddec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/dsddec.c b/libavcodec/dsddec.c index 7c3ae15768..39837a5ad9 100644 --- a/libavcodec/dsddec.c +++ b/libavcodec/dsddec.c @@ -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); |