aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-10-01 12:16:56 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-10-01 12:16:56 -0700
commit1ef3f5d6204f1cf7d312bf3bdf66e23170480ea6 (patch)
treefdc94cfd9f4adeacff75a769c621cb14be421c31
parentf5b4032cb3734d802f93bad017955e7b552413b6 (diff)
parent25b209f229879a155759d791fe463b8abd283677 (diff)
downloadfdk-aac-1ef3f5d6204f1cf7d312bf3bdf66e23170480ea6.tar.gz
fdk-aac-1ef3f5d6204f1cf7d312bf3bdf66e23170480ea6.tar.bz2
fdk-aac-1ef3f5d6204f1cf7d312bf3bdf66e23170480ea6.zip
Always check whether given channel config is supported.
am: 25b209f229 Change-Id: I04b86431f7eccfdc4cef573c594f81ed6e77555a
-rw-r--r--libAACdec/src/aacdecoder.cpp14
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 */