aboutsummaryrefslogtreecommitdiffstats
path: root/fdk-aac/libDRCdec/src/drcDec_reader.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/libDRCdec/src/drcDec_reader.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/libDRCdec/src/drcDec_reader.cpp')
-rw-r--r--fdk-aac/libDRCdec/src/drcDec_reader.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/fdk-aac/libDRCdec/src/drcDec_reader.cpp b/fdk-aac/libDRCdec/src/drcDec_reader.cpp
index 6fe7a04..9b5403a 100644
--- a/fdk-aac/libDRCdec/src/drcDec_reader.cpp
+++ b/fdk-aac/libDRCdec/src/drcDec_reader.cpp
@@ -185,10 +185,18 @@ drcDec_readUniDrc(HANDLE_FDK_BITSTREAM hBs, HANDLE_UNI_DRC_CONFIG hUniDrcConfig,
uniDrcConfigPresent = FDKreadBits(hBs, 1);
if (uniDrcConfigPresent) {
err = drcDec_readUniDrcConfig(hBs, hUniDrcConfig);
- if (err) return err;
+ if (err) {
+ /* clear config, if parsing error occured */
+ FDKmemclear(hUniDrcConfig, sizeof(UNI_DRC_CONFIG));
+ hUniDrcConfig->diff = 1;
+ }
}
err = drcDec_readLoudnessInfoSet(hBs, hLoudnessInfoSet);
- if (err) return err;
+ if (err) {
+ /* clear config, if parsing error occured */
+ FDKmemclear(hLoudnessInfoSet, sizeof(LOUDNESS_INFO_SET));
+ hLoudnessInfoSet->diff = 1;
+ }
}
if (hUniDrcGain != NULL) {
@@ -903,7 +911,7 @@ static void _skipEqCoefficients(HANDLE_FDK_BITSTREAM hBs) {
firFilterOrder;
int uniqueEqSubbandGainsCount, eqSubbandGainRepresentation,
eqSubbandGainCount;
- EQ_SUBBAND_GAIN_FORMAT eqSubbandGainFormat;
+ int eqSubbandGainFormat;
eqDelayMaxPresent = FDKreadBits(hBs, 1);
if (eqDelayMaxPresent) {
@@ -944,7 +952,7 @@ static void _skipEqCoefficients(HANDLE_FDK_BITSTREAM hBs) {
uniqueEqSubbandGainsCount = FDKreadBits(hBs, 6);
if (uniqueEqSubbandGainsCount > 0) {
eqSubbandGainRepresentation = FDKreadBits(hBs, 1);
- eqSubbandGainFormat = (EQ_SUBBAND_GAIN_FORMAT)FDKreadBits(hBs, 4);
+ eqSubbandGainFormat = FDKreadBits(hBs, 4);
switch (eqSubbandGainFormat) {
case GF_QMF32:
eqSubbandGainCount = 32;
@@ -1130,7 +1138,7 @@ static DRC_ERROR _readDrcCoefficientsUniDrc(HANDLE_FDK_BITSTREAM hBs,
drcCharacteristicLeftPresent = FDKreadBits(hBs, 1);
if (drcCharacteristicLeftPresent) {
pCoef->characteristicLeftCount = FDKreadBits(hBs, 4);
- if ((pCoef->characteristicLeftCount + 1) > 8) return DE_MEMORY_ERROR;
+ if ((pCoef->characteristicLeftCount + 1) > 16) return DE_MEMORY_ERROR;
for (i = 0; i < pCoef->characteristicLeftCount; i++) {
err = _readCustomDrcCharacteristic(
hBs, CS_LEFT, &(pCoef->characteristicLeftFormat[i + 1]),
@@ -1141,7 +1149,7 @@ static DRC_ERROR _readDrcCoefficientsUniDrc(HANDLE_FDK_BITSTREAM hBs,
drcCharacteristicRightPresent = FDKreadBits(hBs, 1);
if (drcCharacteristicRightPresent) {
pCoef->characteristicRightCount = FDKreadBits(hBs, 4);
- if ((pCoef->characteristicRightCount + 1) > 8) return DE_MEMORY_ERROR;
+ if ((pCoef->characteristicRightCount + 1) > 16) return DE_MEMORY_ERROR;
for (i = 0; i < pCoef->characteristicRightCount; i++) {
err = _readCustomDrcCharacteristic(
hBs, CS_RIGHT, &(pCoef->characteristicRightFormat[i + 1]),