aboutsummaryrefslogtreecommitdiffstats
path: root/libDRCdec/src/drcDec_reader.cpp
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2019-09-05 16:53:26 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2019-09-05 16:53:26 +0000
commitd929f68a05f5cbdd812dca287c8115a39439acf1 (patch)
treefa62c4f58bc140ba5c0a27e2c913d3ea0a5bfe98 /libDRCdec/src/drcDec_reader.cpp
parentc2eb64586d6dfc0f067ea66631b38d1922a106ed (diff)
parenta209adb315f970aa97044a82551a6f5617d61ded (diff)
downloadfdk-aac-d929f68a05f5cbdd812dca287c8115a39439acf1.tar.gz
fdk-aac-d929f68a05f5cbdd812dca287c8115a39439acf1.tar.bz2
fdk-aac-d929f68a05f5cbdd812dca287c8115a39439acf1.zip
Merge "DO NOT MERGE - Merge Android 10 into master"
Diffstat (limited to 'libDRCdec/src/drcDec_reader.cpp')
-rw-r--r--libDRCdec/src/drcDec_reader.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/libDRCdec/src/drcDec_reader.cpp b/libDRCdec/src/drcDec_reader.cpp
index 6fe7a04..a784457 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) {
@@ -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]),