diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-09-16 10:15:54 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2020-09-16 10:15:54 +0200 |
commit | ac10ac25317d2027e21b1390054e47201e7aec98 (patch) | |
tree | 4b1114b5806709d99634c1b1571e3fe1ed0a7417 /fdk-aac/libDRCdec/src/drcDec_reader.cpp | |
parent | c9b14925962bf6ca3978dc07bf8db32ada7003c5 (diff) | |
download | ODR-AudioEnc-ac10ac25317d2027e21b1390054e47201e7aec98.tar.gz ODR-AudioEnc-ac10ac25317d2027e21b1390054e47201e7aec98.tar.bz2 ODR-AudioEnc-ac10ac25317d2027e21b1390054e47201e7aec98.zip |
Update fdk-aac
This corresponds to 9718203 in https://github.com/Opendigitalradio/fdk-aac
Diffstat (limited to 'fdk-aac/libDRCdec/src/drcDec_reader.cpp')
-rw-r--r-- | fdk-aac/libDRCdec/src/drcDec_reader.cpp | 20 |
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]), |