aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2017-11-03 19:48:03 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-11-03 19:48:03 +0000
commit80fad5a6c10488c250738f2729ed6bd225edf640 (patch)
tree80e5f3acddf7dd5c814df92d65d6c07f1140c207
parent4ccdac99fe02e2f3b2df26924d0f9a11e4ff8b1b (diff)
parent3c6799a870cc69678217612bb86d46b0401cca55 (diff)
downloadfdk-aac-80fad5a6c10488c250738f2729ed6bd225edf640.tar.gz
fdk-aac-80fad5a6c10488c250738f2729ed6bd225edf640.tar.bz2
fdk-aac-80fad5a6c10488c250738f2729ed6bd225edf640.zip
Fix out of bound memory access in lppTransposer am: 6d3dd40e20 am: 2a7b438754 am: fca1027937 am: d8e897ae9e am: 6e15baff97 am: 06c27a9feb am: e6b649a380 am: 902decfc99 am: 77aac03fb6 am: 5a2ae5cc27 am: 117691fe59 am: 60c9a6e4c7 am: 565a2fba56
am: 3c6799a870 Change-Id: I5c065e48a043c697c801f84a26bf9dedde9750da
-rw-r--r--libSBRdec/src/lpp_tran.cpp10
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