diff options
author | Bill Yi <byi@google.com> | 2018-11-28 18:34:17 -0800 |
---|---|---|
committer | Bill Yi <byi@google.com> | 2018-11-28 18:34:17 -0800 |
commit | a342c8b68c8bd9d92a4c0f807cbc6230d8b45e5c (patch) | |
tree | 66fe1fc4eb2c283bcebf91e53f365c6b22f1b47c /libAACdec/src/aacdecoder.cpp | |
parent | f76ceebf7a0ab901ac6586d764ae47576c17e08c (diff) | |
parent | b97c2a93f288df43dd7cc0c45640509a17dddb18 (diff) | |
download | fdk-aac-a342c8b68c8bd9d92a4c0f807cbc6230d8b45e5c.tar.gz fdk-aac-a342c8b68c8bd9d92a4c0f807cbc6230d8b45e5c.tar.bz2 fdk-aac-a342c8b68c8bd9d92a4c0f807cbc6230d8b45e5c.zip |
Merge pi-qpr1-release PQ1A.181105.017.A1 to pi-platform-release
Change-Id: If3ff263d4f628f2c6d4ad3c28d0571284ca1f56d
Diffstat (limited to 'libAACdec/src/aacdecoder.cpp')
-rw-r--r-- | libAACdec/src/aacdecoder.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/libAACdec/src/aacdecoder.cpp b/libAACdec/src/aacdecoder.cpp index b8b1327..362e0b6 100644 --- a/libAACdec/src/aacdecoder.cpp +++ b/libAACdec/src/aacdecoder.cpp @@ -2519,8 +2519,14 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame( if (!(self->flags[0] & (AC_USAC | AC_RSVD50 | AC_RSV603DA | AC_ELD | AC_SCALABLE | AC_ER))) type = (MP4_ELEMENT_ID)FDKreadBits(bs, 3); - else + else { + if (element_count >= (3 * ((8) * 2) + (((8) * 2)) / 2 + 4 * (1) + 1)) { + self->frameOK = 0; + ErrorStatus = AAC_DEC_PARSE_ERROR; + break; + } type = self->elements[element_count]; + } if ((self->flags[streamIndex] & (AC_USAC | AC_RSVD50) && element_count == 0) || @@ -2564,6 +2570,11 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame( case ID_USAC_SCE: case ID_USAC_CPE: case ID_USAC_LFE: + if (element_count >= (3 * ((8) * 2) + (((8) * 2)) / 2 + 4 * (1) + 1)) { + self->frameOK = 0; + ErrorStatus = AAC_DEC_PARSE_ERROR; + break; + } el_channels = CAacDecoder_GetELChannels( type, self->usacStereoConfigIndex[element_count]); @@ -2795,12 +2806,24 @@ LINKSPEC_CPP AAC_DECODER_ERROR CAacDecoder_DecodeFrame( } break; case ID_EXT: + if (element_count >= (3 * ((8) * 2) + (((8) * 2)) / 2 + 4 * (1) + 1)) { + self->frameOK = 0; + ErrorStatus = AAC_DEC_PARSE_ERROR; + break; + } + ErrorStatus = aacDecoder_ParseExplicitMpsAndSbr( self, bs, previous_element, previous_element_index, element_count, el_cnt); break; case ID_USAC_EXT: { + if ((element_count - element_count_prev_streams) >= + TP_USAC_MAX_ELEMENTS) { + self->frameOK = 0; + ErrorStatus = AAC_DEC_PARSE_ERROR; + break; + } /* parse extension element payload q.v. rsv603daExtElement() ISO/IEC DIS 23008-3 Table 30 or UsacExElement() ISO/IEC FDIS 23003-3:2011(E) Table 21 |