avcodec/adpcm: check block_align for PSXC

Fixes: division by 0
Fixes: 457634826/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_PSXC_DEC_fuzzer-4903668521697280

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:
Michael Niedermayer
2025-12-22 18:30:52 +01:00
committed by James Almer
parent 13c91c97d1
commit 8ac6325143

View File

@@ -294,7 +294,7 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
break;
case AV_CODEC_ID_ADPCM_PSXC:
max_channels = 8;
if (avctx->ch_layout.nb_channels <= 0)
if (avctx->ch_layout.nb_channels <= 0 || avctx->block_align <= 0)
return AVERROR_INVALIDDATA;
break;
case AV_CODEC_ID_ADPCM_IMA_DAT4: