diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2018-06-08 18:07:14 +0200 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-10-20 00:16:57 +0000 |
commit | ce97e7d55e1f69683b5bc8f19cc8da8c85bc2cd4 (patch) | |
tree | 3f39efeb09026bcbc2f67009831d9c401d01adf0 /libAACdec/src | |
parent | b97c2a93f288df43dd7cc0c45640509a17dddb18 (diff) | |
download | fdk-aac-ce97e7d55e1f69683b5bc8f19cc8da8c85bc2cd4.tar.gz fdk-aac-ce97e7d55e1f69683b5bc8f19cc8da8c85bc2cd4.tar.bz2 fdk-aac-ce97e7d55e1f69683b5bc8f19cc8da8c85bc2cd4.zip |
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 25b209f229879a155759d791fe463b8abd283677)
Diffstat (limited to 'libAACdec/src')
-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 */ |