mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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>
This commit is contained in:
parent
620236e4d2
commit
2570a8777e
@ -44,6 +44,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
int i;
|
int i;
|
||||||
uint8_t silence;
|
uint8_t silence;
|
||||||
|
|
||||||
|
if (!avctx->channels)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
ff_init_dsd_data();
|
ff_init_dsd_data();
|
||||||
|
|
||||||
s = av_malloc_array(sizeof(DSDContext), avctx->channels);
|
s = av_malloc_array(sizeof(DSDContext), avctx->channels);
|
||||||
|
Loading…
Reference in New Issue
Block a user