summaryrefslogtreecommitdiffstats
path: root/fdk-aac/libSACdec/src/sac_bitdec.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-09-17 15:05:35 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-09-17 15:05:35 +0200
commit321a2c3eead634329cda904dbd38d986c3f22c11 (patch)
treec4339c85c03dd103e0e3ee7b8fb1445c1fc4ffa8 /fdk-aac/libSACdec/src/sac_bitdec.cpp
parentb65cd1fe9d453365f0dec0c80d8737eda3d1c338 (diff)
parentac10ac25317d2027e21b1390054e47201e7aec98 (diff)
downloadODR-AudioEnc-321a2c3eead634329cda904dbd38d986c3f22c11.tar.gz
ODR-AudioEnc-321a2c3eead634329cda904dbd38d986c3f22c11.tar.bz2
ODR-AudioEnc-321a2c3eead634329cda904dbd38d986c3f22c11.zip
Merge branch 'next' into padsocket
Diffstat (limited to 'fdk-aac/libSACdec/src/sac_bitdec.cpp')
-rw-r--r--fdk-aac/libSACdec/src/sac_bitdec.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/fdk-aac/libSACdec/src/sac_bitdec.cpp b/fdk-aac/libSACdec/src/sac_bitdec.cpp
index 883e1e8..062eb1c 100644
--- a/fdk-aac/libSACdec/src/sac_bitdec.cpp
+++ b/fdk-aac/libSACdec/src/sac_bitdec.cpp
@@ -448,6 +448,7 @@ SACDEC_ERROR SpatialDecParseSpecificConfig(
int bsFreqRes, b3DaudioMode = 0;
int numHeaderBits;
int cfgStartPos, bitsAvailable;
+ int treeConfig;
FDKmemclear(pSpatialSpecificConfig, sizeof(SPATIAL_SPECIFIC_CONFIG));
@@ -488,13 +489,13 @@ SACDEC_ERROR SpatialDecParseSpecificConfig(
pSpatialSpecificConfig->freqRes =
(SPATIALDEC_FREQ_RES)freqResTable_LD[bsFreqRes];
- pSpatialSpecificConfig->treeConfig =
- (SPATIALDEC_TREE_CONFIG)FDKreadBits(bitstream, 4);
+ treeConfig = FDKreadBits(bitstream, 4);
- if (pSpatialSpecificConfig->treeConfig != SPATIALDEC_MODE_RSVD7) {
+ if (treeConfig != SPATIALDEC_MODE_RSVD7) {
err = MPS_UNSUPPORTED_CONFIG;
goto bail;
}
+ pSpatialSpecificConfig->treeConfig = (SPATIALDEC_TREE_CONFIG) treeConfig;
{
pSpatialSpecificConfig->nOttBoxes =
@@ -1457,7 +1458,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 +1563,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];