aboutsummaryrefslogtreecommitdiffstats
path: root/libSACdec
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2019-03-08 14:52:26 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-03-08 14:52:26 +0000
commitf164a97189891fb058080b831bef7431a25f3aa2 (patch)
tree0e450f986540ec4063bff73fbc8d754aae93c843 /libSACdec
parentea08af4499b9a722a0a6085aa74929b5741209e7 (diff)
parent8e27e0bd3004b41ebc61be9f8b19a0cb4787f39b (diff)
downloadfdk-aac-f164a97189891fb058080b831bef7431a25f3aa2.tar.gz
fdk-aac-f164a97189891fb058080b831bef7431a25f3aa2.tar.bz2
fdk-aac-f164a97189891fb058080b831bef7431a25f3aa2.zip
Merge "AAC decoder: fix use of uninitialized value, check index"
Diffstat (limited to 'libSACdec')
-rw-r--r--libSACdec/src/sac_bitdec.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libSACdec/src/sac_bitdec.cpp b/libSACdec/src/sac_bitdec.cpp
index 883e1e8..a1bdca4 100644
--- a/libSACdec/src/sac_bitdec.cpp
+++ b/libSACdec/src/sac_bitdec.cpp
@@ -1457,7 +1457,7 @@ static SACDEC_ERROR mapIndexData(
FIXP_DBL (*pOttVsTotDb1)[MAX_PARAMETER_SETS][MAX_PARAMETER_BANDS],
FIXP_DBL (*pOttVsTotDb2)[MAX_PARAMETER_SETS][MAX_PARAMETER_BANDS]) {
int aParamSlots[MAX_PARAMETER_SETS];
- int aInterpolate[MAX_PARAMETER_SETS];
+ int aInterpolate[MAX_PARAMETER_SETS] = {0};
int dataSets;
int aMap[MAX_PARAMETER_BANDS + 1];
@@ -1562,6 +1562,7 @@ static SACDEC_ERROR mapIndexData(
i2 = i;
while (aInterpolate[i2] == 1) {
i2++;
+ if (i2 >= MAX_PARAMETER_SETS) return MPS_WRONG_PARAMETERSETS;
}
x1 = paramSlot[i1];
xi = paramSlot[i];