aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRdec/src
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2017-11-03 19:21:31 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-11-03 19:21:31 +0000
commite6b649a380382eacab98b854cdd1ff71704c09da (patch)
tree77a2e96c0d102dbc846a13bc59442d45ec5a103c /libSBRdec/src
parent67a321cd1702f9fbb9ce268dbd4da29f2fbdfc8d (diff)
parent06c27a9feb7f3e5b94b5850f0ea2ae3a43e733a7 (diff)
downloadfdk-aac-e6b649a380382eacab98b854cdd1ff71704c09da.tar.gz
fdk-aac-e6b649a380382eacab98b854cdd1ff71704c09da.tar.bz2
fdk-aac-e6b649a380382eacab98b854cdd1ff71704c09da.zip
Fix out of bound memory access in lppTransposer am: 6d3dd40e20 am: 2a7b438754 am: fca1027937 am: d8e897ae9e am: 6e15baff97
am: 06c27a9feb Change-Id: Id5bfc33a815aec69a302b5ba1460ad2d556c9179
Diffstat (limited to 'libSBRdec/src')
-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