mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-03 14:32:16 +02:00
avcodec/adpcm: Check channels before use for ADPCM_PSX
Fixes: division by zero Fixes: 26293/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5176665237618688 Fixes: 26331/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSX_fuzzer-5632330364092416 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
a4895b75a3
commit
4ebe40ef64
@ -135,7 +135,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
|
||||
break;
|
||||
case AV_CODEC_ID_ADPCM_PSX:
|
||||
max_channels = 8;
|
||||
if (avctx->block_align % (16 * avctx->channels))
|
||||
if (avctx->channels <= 0 || avctx->block_align % (16 * avctx->channels))
|
||||
return AVERROR_INVALIDDATA;
|
||||
break;
|
||||
case AV_CODEC_ID_ADPCM_IMA_DAT4:
|
||||
|
Loading…
x
Reference in New Issue
Block a user