diff options
Diffstat (limited to 'libDRCdec/src')
-rw-r--r-- | libDRCdec/src/drcGainDec_preprocess.cpp | 2 | ||||
-rw-r--r-- | libDRCdec/src/drcGainDec_process.cpp | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/libDRCdec/src/drcGainDec_preprocess.cpp b/libDRCdec/src/drcGainDec_preprocess.cpp index c543c53..514e977 100644 --- a/libDRCdec/src/drcGainDec_preprocess.cpp +++ b/libDRCdec/src/drcGainDec_preprocess.cpp @@ -676,6 +676,7 @@ prepareDrcGain(HANDLE_DRC_GAIN_DECODER hGainDec, nDrcBands = pActiveDrc->bandCountForChannelGroup[g]; for (b = 0; b < nDrcBands; b++) { DRC_ERROR err = DE_OK; + if (gainSetIndex >= 12) return DE_PARAM_OUT_OF_RANGE; GAIN_SET* pGainSet = &(pCoef->gainSet[gainSetIndex]); int seq = pGainSet->gainSequenceIndex[b]; DRC_CHARACTERISTIC* pDChar = &(pGainSet->drcCharacteristic[b]); @@ -694,6 +695,7 @@ prepareDrcGain(HANDLE_DRC_GAIN_DECODER hGainDec, err = _prepareDrcCharacteristic(pDChar, pCoef, b, &nodeMod); if (err) return err; + if (seq >= 12) return DE_PARAM_OUT_OF_RANGE; /* copy a node buffer and convert from dB to linear */ pLnb->nNodes[lnbp] = fMin((int)hUniDrcGain->nNodes[seq], 16); for (i = 0; i < pLnb->nNodes[lnbp]; i++) { diff --git a/libDRCdec/src/drcGainDec_process.cpp b/libDRCdec/src/drcGainDec_process.cpp index 70c9533..1894f47 100644 --- a/libDRCdec/src/drcGainDec_process.cpp +++ b/libDRCdec/src/drcGainDec_process.cpp @@ -308,6 +308,8 @@ processDrcTime(HANDLE_DRC_GAIN_DECODER hGainDec, const int activeDrcIndex, pLinearNodeBuffer[pActiveDrc->lnbIndexForChannel[c][lnbIx] + b]); else pLnbPrevious = pDummyLnb; + if (pLnbPrevious->nNodes[lnbIx] <= 0 || pLnbPrevious->nNodes[lnbIx] > 16) + return DE_NOT_OK; nodePrevious = pLnbPrevious->linearNode[lnbIx][pLnbPrevious->nNodes[lnbIx] - 1]; nodePrevious.time -= hGainDec->frameSize; |