aboutsummaryrefslogtreecommitdiffstats
path: root/libDRCdec
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2020-04-17 15:08:00 +0200
committerRay Essick <essick@google.com>2021-02-14 12:23:12 -0800
commit0c2c08aef6849fdec71cae4d769c6cd3dd86303d (patch)
treef0016341f725003884c2646f38b9370466183142 /libDRCdec
parent5e031b67ba74f2713af8f4237f43825742c0a28a (diff)
downloadfdk-aac-0c2c08aef6849fdec71cae4d769c6cd3dd86303d.tar.gz
fdk-aac-0c2c08aef6849fdec71cae4d769c6cd3dd86303d.tar.bz2
fdk-aac-0c2c08aef6849fdec71cae4d769c6cd3dd86303d.zip
Read uniDrcGainExtension element only if all DRC gain sequences are parsed correctly.
Prevent error return during parsing of incomplete uniDrcGain() element. This fixes unnecessary concealment of frames for AAC in case a uniDrcGain() is provided, but the uniDrcConfig() element is not available. Bug: 176246647 Test: atest android.media.cts.DecoderTestAacFormat android.media.cts.DecoderTestXheAac android.media.cts.DecoderTestAacDrc Change-Id: I5ae343eaea481774c53240dbce4da0f4ff06cd1d
Diffstat (limited to 'libDRCdec')
-rw-r--r--libDRCdec/src/drcDec_reader.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/libDRCdec/src/drcDec_reader.cpp b/libDRCdec/src/drcDec_reader.cpp
index 367a352..b3ec187 100644
--- a/libDRCdec/src/drcDec_reader.cpp
+++ b/libDRCdec/src/drcDec_reader.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -512,10 +512,13 @@ drcDec_readUniDrcGain(HANDLE_FDK_BITSTREAM hBs,
fMin(tmpNNodes, (UCHAR)16) * sizeof(GAIN_NODE));
}
- hUniDrcGain->uniDrcGainExtPresent = FDKreadBits(hBs, 1);
- if (hUniDrcGain->uniDrcGainExtPresent == 1) {
- err = _readUniDrcGainExtension(hBs, &(hUniDrcGain->uniDrcGainExtension));
- if (err) return err;
+ if (pCoef && (gainSequenceCount ==
+ pCoef->gainSequenceCount)) { /* all sequences have been read */
+ hUniDrcGain->uniDrcGainExtPresent = FDKreadBits(hBs, 1);
+ if (hUniDrcGain->uniDrcGainExtPresent == 1) {
+ err = _readUniDrcGainExtension(hBs, &(hUniDrcGain->uniDrcGainExtension));
+ if (err) return err;
+ }
}
if (err == DE_OK && gainSequenceCount > 0) {