aboutsummaryrefslogtreecommitdiffstats
path: root/libDRCdec
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-12-20 15:52:46 +0100
committerJean-Michel Trivi <jmtrivi@google.com>2019-03-14 15:01:30 -0700
commita1f6034653ad9025432bcd7071573172d24c1d6f (patch)
tree850976122716be1924242a32582cb7410687be37 /libDRCdec
parent358e6d14ac6048827c4894fa6eb461d4ddac9e3f (diff)
downloadfdk-aac-a1f6034653ad9025432bcd7071573172d24c1d6f.tar.gz
fdk-aac-a1f6034653ad9025432bcd7071573172d24c1d6f.tar.bz2
fdk-aac-a1f6034653ad9025432bcd7071573172d24c1d6f.zip
Clear config in case of parsing error in drcDec_readUniDrc()
Change-Id: I827a1ddbed2cf10e6b4fabdea2bf3f71c8f30c6f
Diffstat (limited to 'libDRCdec')
-rw-r--r--libDRCdec/src/drcDec_reader.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/libDRCdec/src/drcDec_reader.cpp b/libDRCdec/src/drcDec_reader.cpp
index e7b3360..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) {