aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-08-15 14:33:56 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2018-09-27 14:28:50 -0700
commitf2bc07da2ed70eb069f3faab1179c4c89792bf3d (patch)
tree798025f642f61240512be63fe16e2344a0f2bee8 /libAACdec
parentf19e863cce96cc1e5f4ad7ce512810d5a2843ea6 (diff)
downloadfdk-aac-f2bc07da2ed70eb069f3faab1179c4c89792bf3d.tar.gz
fdk-aac-f2bc07da2ed70eb069f3faab1179c4c89792bf3d.tar.bz2
fdk-aac-f2bc07da2ed70eb069f3faab1179c4c89792bf3d.zip
Unify audio element loop abort criterion in ER syntax
Bug: 112891548 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: Iea56cf804cfb9d396810124c718fc91bdff68392
Diffstat (limited to 'libAACdec')
-rw-r--r--libAACdec/src/aacdecoder.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
index b8b1327..272de9f 100644
--- a/libAACdec/src/aacdecoder.cpp
+++ b/libAACdec/src/aacdecoder.cpp
@@ -2055,17 +2055,12 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
if (self->flags[streamIndex] & (AC_RSV603DA | AC_USAC)) {
_numElements = (int)asc->m_sc.m_usacConfig.m_usacNumElements;
}
- if (self->flags[streamIndex] & (AC_ER | AC_LD | AC_ELD)) {
- _numElements = (asc->m_channelConfiguration == 7)
- ? 8
- : asc->m_channelConfiguration;
- }
for (int _el = 0; _el < _numElements; _el++) {
int el_channels = 0;
int el = elementOffset + _el;
if (self->flags[streamIndex] &
- (AC_ELD | AC_RSV603DA | AC_USAC | AC_RSVD50)) {
+ (AC_ER | AC_LD | AC_ELD | AC_RSV603DA | AC_USAC | AC_RSVD50)) {
if (ch >= ascChannels) {
break;
}
@@ -2115,7 +2110,9 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
(SPECTRAL_PTR)&self->workBufferCore2[ch * 1024];
if (el_channels == 2) {
- FDK_ASSERT(ch < (8) - 1);
+ if (ch >= (8) - 1) {
+ return AAC_DEC_UNSUPPORTED_CHANNELCONFIG;
+ }
self->pAacDecoderChannelInfo[ch + 1]->pComData =
self->pAacDecoderChannelInfo[ch]->pComData;
self->pAacDecoderChannelInfo[ch + 1]->pComStaticData =