aboutsummaryrefslogtreecommitdiffstats
path: root/libDRCdec/src/drcDec_reader.cpp
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 08:53:44 -0700
commitc2e0dfe237e2a3bd8a43e8a8025631d6fec4590d (patch)
treefa9cf8524e176b2941779581b3dd6ae191c56c2e /libDRCdec/src/drcDec_reader.cpp
parentf164a97189891fb058080b831bef7431a25f3aa2 (diff)
downloadfdk-aac-c2e0dfe237e2a3bd8a43e8a8025631d6fec4590d.tar.gz
fdk-aac-c2e0dfe237e2a3bd8a43e8a8025631d6fec4590d.tar.bz2
fdk-aac-c2e0dfe237e2a3bd8a43e8a8025631d6fec4590d.zip
Clear config in case of parsing error in drcDec_readUniDrc()
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: Ic1a12cbd31aa51d8a89bc4d6a67f9b0289265b6c
Diffstat (limited to 'libDRCdec/src/drcDec_reader.cpp')
-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 6fe7a04..469203e 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) {