aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2021-03-16 14:42:02 +0100
committerJean-Michel Trivi <jmtrivi@google.com>2021-04-29 12:57:20 -0700
commit0527875be6340013e933a26e296211999f5377cb (patch)
treebe2f866a9aefc86277b7aaf6c7530993c598ef55 /libAACdec
parent5f80d21a8a5ee31d7eb4b6d171223aa357fdf629 (diff)
downloadfdk-aac-0527875be6340013e933a26e296211999f5377cb.tar.gz
fdk-aac-0527875be6340013e933a26e296211999f5377cb.tar.bz2
fdk-aac-0527875be6340013e933a26e296211999f5377cb.zip
Follow-up on: Improve decoder robustness by storing flags and elFlags temporarily.
Bug: 186777497 Test: atest android.media.cts.DecoderTestAacFormat android.media.cts.DecoderTestXheAac android.media.cts.DecoderTestAacDrc Change-Id: I2aef40ef1868832cd00e4d761b060aa41b1b7efa
Diffstat (limited to 'libAACdec')
-rw-r--r--libAACdec/src/aacdecoder.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
index c18e5e9..7c16d2a 100644
--- a/libAACdec/src/aacdecoder.cpp
+++ b/libAACdec/src/aacdecoder.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2020 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2021 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -1417,11 +1417,7 @@ static void CAacDecoder_AcceptFlags(HANDLE_AACDECODER self,
const CSAudioSpecificConfig *asc,
UINT flags, UINT *elFlags, int streamIndex,
int elementOffset) {
- {
- FDKmemcpy(
- self->elFlags, elFlags,
- sizeof(*elFlags) * (3 * ((8) * 2) + (((8) * 2)) / 2 + 4 * (1) + 1));
- }
+ FDKmemcpy(self->elFlags, elFlags, sizeof(self->elFlags));
self->flags[streamIndex] = flags;
}
@@ -1524,6 +1520,8 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
INT flushChannels = 0;
UINT flags;
+ /* elFlags[(3*MAX_CHANNELS + (MAX_CHANNELS)/2 + 4 * (MAX_TRACKS) + 1]
+ where MAX_CHANNELS is (8*2) and MAX_TRACKS is 1 */
UINT elFlags[(3 * ((8) * 2) + (((8) * 2)) / 2 + 4 * (1) + 1)];
if (!self) return AAC_DEC_INVALID_HANDLE;