avcodec/aac/aacdec_usac: Limit sfo from noise offset to be above -200

Fixes: out of array read
Fixes: 397731127/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5577772965101568

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-05-08 23:33:28 +02:00
parent 01a1b99fc2
commit d643a5ba08

View File

@@ -1023,8 +1023,9 @@ static void apply_noise_fill(AACDecContext *ac, SingleChannelElement *sce,
}
}
if (band_quantized_to_zero)
sce->sfo[g*ics->max_sfb + sfb] += noise_offset;
if (band_quantized_to_zero) {
sce->sfo[g*ics->max_sfb + sfb] = FFMAX(sce->sfo[g*ics->max_sfb + sfb] + noise_offset, -200);
}
}
coef += g_len << 7;
}