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
This commit is contained in:
Fraunhofer IIS FDK 2021-03-16 14:42:02 +01:00 committed by Jean-Michel Trivi
parent 5f80d21a8a
commit 0527875be6
1 changed files with 4 additions and 6 deletions

View File

@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android 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. Forschung e.V. All rights reserved.
1. INTRODUCTION 1. INTRODUCTION
@ -1417,11 +1417,7 @@ static void CAacDecoder_AcceptFlags(HANDLE_AACDECODER self,
const CSAudioSpecificConfig *asc, const CSAudioSpecificConfig *asc,
UINT flags, UINT *elFlags, int streamIndex, UINT flags, UINT *elFlags, int streamIndex,
int elementOffset) { int elementOffset) {
{ FDKmemcpy(self->elFlags, elFlags, sizeof(self->elFlags));
FDKmemcpy(
self->elFlags, elFlags,
sizeof(*elFlags) * (3 * ((8) * 2) + (((8) * 2)) / 2 + 4 * (1) + 1));
}
self->flags[streamIndex] = flags; self->flags[streamIndex] = flags;
} }
@ -1524,6 +1520,8 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
INT flushChannels = 0; INT flushChannels = 0;
UINT flags; 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)]; UINT elFlags[(3 * ((8) * 2) + (((8) * 2)) / 2 + 4 * (1) + 1)];
if (!self) return AAC_DEC_INVALID_HANDLE; if (!self) return AAC_DEC_INVALID_HANDLE;