diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2018-12-20 15:52:47 +0100 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2020-01-22 11:11:56 -0800 |
commit | 3ce7751a440cafe41ff2eefb105b03096fbe122c (patch) | |
tree | a62c4b53e6bfd56c4a9df7b86cb2acc217185b5c /libDRCdec/src/drcDec_gainDecoder.cpp | |
parent | cee316ab3ebde92047b5e76d15c00768b92cb890 (diff) | |
download | fdk-aac-3ce7751a440cafe41ff2eefb105b03096fbe122c.tar.gz fdk-aac-3ce7751a440cafe41ff2eefb105b03096fbe122c.tar.bz2 fdk-aac-3ce7751a440cafe41ff2eefb105b03096fbe122c.zip |
Perform sanity check on DRC sets and improve the selection process
Bug: 137282770
Bug: 141883493
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ie8e17c82653cb0d9adcdb10ec3f4875b6207ac6f
Diffstat (limited to 'libDRCdec/src/drcDec_gainDecoder.cpp')
-rw-r--r-- | libDRCdec/src/drcDec_gainDecoder.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libDRCdec/src/drcDec_gainDecoder.cpp b/libDRCdec/src/drcDec_gainDecoder.cpp index 9d91267..de54dde 100644 --- a/libDRCdec/src/drcDec_gainDecoder.cpp +++ b/libDRCdec/src/drcDec_gainDecoder.cpp @@ -297,9 +297,11 @@ drcDec_GainDecoder_Conceal(HANDLE_DRC_GAIN_DECODER hGainDec, int seq, gainSequenceCount; DRC_COEFFICIENTS_UNI_DRC* pCoef = selectDrcCoefficients(hUniDrcConfig, LOCATION_SELECTED); - if (pCoef == NULL) return DE_OK; - - gainSequenceCount = fMin(pCoef->gainSequenceCount, (UCHAR)12); + if (pCoef && pCoef->gainSequenceCount) { + gainSequenceCount = fMin(pCoef->gainSequenceCount, (UCHAR)12); + } else { + gainSequenceCount = 1; + } for (seq = 0; seq < gainSequenceCount; seq++) { int lastNodeIndex = 0; |