1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-02-16 19:30:34 +01:00

Avoid index-out-of-bounds in prepareDrcGain

Fixes: 16962/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBFDK_AAC_fuzzer-5708503842291712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
This commit is contained in:
Martin Storsjo 2019-09-06 22:42:07 +03:00
parent cc5c85dd70
commit 5ab5496af9

View File

@ -676,6 +676,7 @@ prepareDrcGain(HANDLE_DRC_GAIN_DECODER hGainDec,
nDrcBands = pActiveDrc->bandCountForChannelGroup[g]; nDrcBands = pActiveDrc->bandCountForChannelGroup[g];
for (b = 0; b < nDrcBands; b++) { for (b = 0; b < nDrcBands; b++) {
DRC_ERROR err = DE_OK; DRC_ERROR err = DE_OK;
if (gainSetIndex >= 12) return DE_PARAM_OUT_OF_RANGE;
GAIN_SET* pGainSet = &(pCoef->gainSet[gainSetIndex]); GAIN_SET* pGainSet = &(pCoef->gainSet[gainSetIndex]);
int seq = pGainSet->gainSequenceIndex[b]; int seq = pGainSet->gainSequenceIndex[b];
DRC_CHARACTERISTIC* pDChar = &(pGainSet->drcCharacteristic[b]); DRC_CHARACTERISTIC* pDChar = &(pGainSet->drcCharacteristic[b]);