aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src
diff options
context:
space:
mode:
authorBill Rassieur <rassb@google.com>2018-12-04 16:59:15 +0000
committerBill Rassieur <rassb@google.com>2018-12-04 16:59:15 +0000
commit33acbd97b67a3c740f7b54fae2ce127803b70c20 (patch)
tree5cf8e51e0b896f3da4e70112dce18516917d4a7a /libAACdec/src
parenta342c8b68c8bd9d92a4c0f807cbc6230d8b45e5c (diff)
parent9ea938f95032002c66308b6c81761817ab80eb2d (diff)
downloadfdk-aac-33acbd97b67a3c740f7b54fae2ce127803b70c20.tar.gz
fdk-aac-33acbd97b67a3c740f7b54fae2ce127803b70c20.tar.bz2
fdk-aac-33acbd97b67a3c740f7b54fae2ce127803b70c20.zip
Merge PQ1A.181205.006 from Pi-QPR1-Release into ToT for Pi-Platform release.\n\nBUG: 120448245
Change-Id: I1d3ce7e7d198f3256d3ecbd932f8d6f9977ba16d
Diffstat (limited to 'libAACdec/src')
-rw-r--r--libAACdec/src/aacdecoder.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp
index 362e0b6..24907ee 100644
--- a/libAACdec/src/aacdecoder.cpp
+++ b/libAACdec/src/aacdecoder.cpp
@@ -1630,17 +1630,9 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
aacChannelsOffset = 0;
aacChannelsOffsetIdx = 0;
elementOffset = 0;
- if (configMode & AC_CM_ALLOC_MEM) {
- if ((ascChannels <= 0) ||
- (asc->m_channelConfiguration > AACDEC_MAX_CH_CONF)) {
- return AAC_DEC_UNSUPPORTED_CHANNELCONFIG;
- }
- if ((ascChannels + aacChannelsOffsetIdx) > ((8) * 2)) {
- return AAC_DEC_UNSUPPORTED_CHANNELCONFIG;
- }
- if ((ascChannels + aacChannelsOffset) > (8)) {
- return AAC_DEC_UNSUPPORTED_CHANNELCONFIG;
- }
+ if ((ascChannels <= 0) || (ascChannels > (8)) ||
+ (asc->m_channelConfiguration > AACDEC_MAX_CH_CONF)) {
+ return AAC_DEC_UNSUPPORTED_CHANNELCONFIG;
}
/* Set syntax flags */
@@ -2055,17 +2047,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 +2102,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 =