aboutsummaryrefslogtreecommitdiffstats
path: root/libDRCdec/src/drcDec_gainDecoder.cpp
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2020-01-22 22:57:04 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-01-22 22:57:04 +0000
commit44b9543d921d899e2edae88dea9e2566fed861f0 (patch)
tree8a0f568088d14cc0de6ec52ac6e5d6787967b1fa /libDRCdec/src/drcDec_gainDecoder.cpp
parentcedcc475f52dd704497524dda6ec2ef430d2b6c5 (diff)
parent3ce7751a440cafe41ff2eefb105b03096fbe122c (diff)
downloadfdk-aac-44b9543d921d899e2edae88dea9e2566fed861f0.tar.gz
fdk-aac-44b9543d921d899e2edae88dea9e2566fed861f0.tar.bz2
fdk-aac-44b9543d921d899e2edae88dea9e2566fed861f0.zip
Merge "Perform sanity check on DRC sets and improve the selection process"
Diffstat (limited to 'libDRCdec/src/drcDec_gainDecoder.cpp')
-rw-r--r--libDRCdec/src/drcDec_gainDecoder.cpp8
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;