diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2018-06-08 18:07:14 +0200 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2018-09-28 16:47:37 +0000 |
commit | 25b209f229879a155759d791fe463b8abd283677 (patch) | |
tree | 32ec9e68e5a0c1531d2ebee308d3e18eb2267f41 /libAACdec | |
parent | 42f714f2ab2bc90ee320ef5f071a078179a59405 (diff) | |
download | fdk-aac-25b209f229879a155759d791fe463b8abd283677.tar.gz fdk-aac-25b209f229879a155759d791fe463b8abd283677.tar.bz2 fdk-aac-25b209f229879a155759d791fe463b8abd283677.zip |
Always check whether given channel config is supported.
Bug: 112660981
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I169161dd31bc624f2cab6be2b4c6518946ed32ba
Merged-In: I169161dd31bc624f2cab6be2b4c6518946ed32ba
Diffstat (limited to 'libAACdec')
-rw-r--r-- | libAACdec/src/aacdecoder.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp index 362e0b6..fab30de 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 */ |