diff options
Diffstat (limited to 'libDRCdec/src/drcDec_reader.cpp')
-rw-r--r-- | libDRCdec/src/drcDec_reader.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/libDRCdec/src/drcDec_reader.cpp b/libDRCdec/src/drcDec_reader.cpp index 6fe7a04..9b5403a 100644 --- a/libDRCdec/src/drcDec_reader.cpp +++ b/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]), |