summaryrefslogtreecommitdiff
path: root/libMpegTPDec
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2019-08-09 17:07:39 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2019-10-11 10:00:20 -0700
commit572f59359a5e71f59a09e2dbc75aa45e7eaaa360 (patch)
tree77e8e6e243a4bb4fbd9be9898ea4117825fb36e7 /libMpegTPDec
parent2b5217a9532ab952c831693e208bdfcb6a0b50eb (diff)
downloadaac-572f59359a5e71f59a09e2dbc75aa45e7eaaa360.tar.gz
Reject unsupported channel configuration / audio object type combinations.
Bug: 131430997 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I84bd355df0f690636c109695d8df64fa7bdcf63c
Diffstat (limited to 'libMpegTPDec')
-rw-r--r--libMpegTPDec/src/tpdec_asc.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/libMpegTPDec/src/tpdec_asc.cpp b/libMpegTPDec/src/tpdec_asc.cpp
index a86c2cb..ad13378 100644
--- a/libMpegTPDec/src/tpdec_asc.cpp
+++ b/libMpegTPDec/src/tpdec_asc.cpp
@@ -2144,6 +2144,24 @@ TRANSPORTDEC_ERROR AudioSpecificConfig_Parse(
self->m_channelConfiguration = FDKreadBits(bs, 4);
+ /* MPEG-04 standard ISO/IEC 14496-3: channelConfiguration == 0 is reserved
+ in er_raw_data_block (table 4.19) and er_raw_data_block_eld (table 4.75)
+ MPEG-04 conformance ISO/IEC 14496-4: channelConfiguration == 0 is not
+ permitted for AOT_ER_AAC_LC, AOT_ER_AAC_LTP, AOT_ER_AAC_LD,
+ AOT_ER_AAC_SCAL (chapter 6.6.4.1.2.1.1) */
+ if ((self->m_channelConfiguration == 0) &&
+ ((self->m_aot == AOT_ER_AAC_LC) || (self->m_aot == AOT_ER_AAC_LTP) ||
+ (self->m_aot == AOT_ER_AAC_LD) || (self->m_aot == AOT_ER_AAC_SCAL) ||
+ (self->m_aot == AOT_ER_AAC_ELD))) {
+ return TRANSPORTDEC_UNSUPPORTED_FORMAT;
+ }
+ /* MPEG-04 conformance ISO/IEC 14496-4: channelConfiguration > 2 is not
+ * permitted for AOT_AAC_SCAL and AOT_ER_AAC_SCAL (chapter 6.6.4.1.2.1.1) */
+ if ((self->m_channelConfiguration > 2) &&
+ ((self->m_aot == AOT_AAC_SCAL) || (self->m_aot == AOT_ER_AAC_SCAL))) {
+ return TRANSPORTDEC_UNSUPPORTED_FORMAT;
+ }
+
/* SBR extension ( explicit non-backwards compatible mode ) */
self->m_sbrPresentFlag = 0;
self->m_psPresentFlag = 0;