Always check whether given channel config is supported.

Bug: 112660981
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I169161dd31bc624f2cab6be2b4c6518946ed32ba
Merged-In: I169161dd31bc624f2cab6be2b4c6518946ed32ba
(cherry picked from commit 25b209f229)
This commit is contained in:
Fraunhofer IIS FDK 2018-06-08 18:07:14 +02:00 committed by android-build-team Robot
parent b97c2a93f2
commit ce97e7d55e
1 changed files with 3 additions and 11 deletions

View File

@ -1630,17 +1630,9 @@ CAacDecoder_Init(HANDLE_AACDECODER self, const CSAudioSpecificConfig *asc,
aacChannelsOffset = 0; aacChannelsOffset = 0;
aacChannelsOffsetIdx = 0; aacChannelsOffsetIdx = 0;
elementOffset = 0; elementOffset = 0;
if (configMode & AC_CM_ALLOC_MEM) { if ((ascChannels <= 0) || (ascChannels > (8)) ||
if ((ascChannels <= 0) || (asc->m_channelConfiguration > AACDEC_MAX_CH_CONF)) {
(asc->m_channelConfiguration > AACDEC_MAX_CH_CONF)) { return AAC_DEC_UNSUPPORTED_CHANNELCONFIG;
return AAC_DEC_UNSUPPORTED_CHANNELCONFIG;
}
if ((ascChannels + aacChannelsOffsetIdx) > ((8) * 2)) {
return AAC_DEC_UNSUPPORTED_CHANNELCONFIG;
}
if ((ascChannels + aacChannelsOffset) > (8)) {
return AAC_DEC_UNSUPPORTED_CHANNELCONFIG;
}
} }
/* Set syntax flags */ /* Set syntax flags */