avcodec/misc4: reject invalid sample rate

Fixes: AVERROR_BUG

Fixes: 493055111/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MISC4_fuzzer-5752676962074624
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
2026-05-31 00:13:59 +02:00
committed by michaelni
parent 0ab097fb34
commit 32eb07bb83
+3
View File
@@ -57,6 +57,9 @@ static av_cold int misc4_init(AVCodecContext *avctx)
{
MISC4Context *s = avctx->priv_data;
if (avctx->sample_rate <= 0)
return AVERROR_INVALIDDATA;
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
switch (avctx->sample_rate) {
case 8000: