diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2017-11-03 19:07:04 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-11-03 19:07:04 +0000 |
commit | 2a7b438754ca7d0ea3d98ca2c21a4e3d48e79241 (patch) | |
tree | ef1bbd3628208cad84055df49262ac75bc214013 /libSBRdec | |
parent | d0e8397b7b621fdc35ae91ffc7ce7847bf3ce1e7 (diff) | |
parent | 6d3dd40e204bf550abcfa589bd9615df8778e118 (diff) | |
download | fdk-aac-2a7b438754ca7d0ea3d98ca2c21a4e3d48e79241.tar.gz fdk-aac-2a7b438754ca7d0ea3d98ca2c21a4e3d48e79241.tar.bz2 fdk-aac-2a7b438754ca7d0ea3d98ca2c21a4e3d48e79241.zip |
Fix out of bound memory access in lppTransposer
am: 6d3dd40e20
Change-Id: I4a2b70c82e6bc42b3a0ec00efeb100fe6971a62c
Diffstat (limited to 'libSBRdec')
-rw-r--r-- | libSBRdec/src/lpp_tran.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libSBRdec/src/lpp_tran.cpp b/libSBRdec/src/lpp_tran.cpp index 117e739..343aec3 100644 --- a/libSBRdec/src/lpp_tran.cpp +++ b/libSBRdec/src/lpp_tran.cpp @@ -293,7 +293,7 @@ void lppTransposer (HANDLE_SBR_LPP_TRANS hLppTrans, /*!< Handle of lpp transp } /* init bwIndex for each patch */ - FDKmemclear(bwIndex, pSettings->noOfPatches*sizeof(INT)); + FDKmemclear(bwIndex, MAX_NUM_PATCHES*sizeof(INT)); /* Calc common low band scale factor @@ -621,9 +621,9 @@ void lppTransposer (HANDLE_SBR_LPP_TRANS hLppTrans, /*!< Handle of lpp transp FDK_ASSERT( hiBand < (64) ); /* bwIndex[patch] is already initialized with value from previous band inside this patch */ - while (hiBand >= pSettings->bwBorders[bwIndex[patch]]) + while (hiBand >= pSettings->bwBorders[bwIndex[patch]] && bwIndex[patch] < MAX_NUM_PATCHES-1) { bwIndex[patch]++; - + } /* Filter Step 2: add the left slope with the current filter to the buffer @@ -962,6 +962,10 @@ resetLppTransposer (HANDLE_SBR_LPP_TRANS hLppTrans, /*!< Handle of lpp transpos for(i = 0 ; i < noNoiseBands; i++){ pSettings->bwBorders[i] = noiseBandTable[i+1]; } + for (;i < MAX_NUM_NOISE_VALUES; i++) { + pSettings->bwBorders[i] = 255; + } + /* * Choose whitening factors |