From ac10ac25317d2027e21b1390054e47201e7aec98 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 16 Sep 2020 10:15:54 +0200 Subject: Update fdk-aac This corresponds to 9718203 in https://github.com/Opendigitalradio/fdk-aac --- fdk-aac/libDRCdec/src/drcDec_reader.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'fdk-aac/libDRCdec/src/drcDec_reader.cpp') 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]), -- cgit v1.2.3