Fix for OOB in external libxaac am: 57b4f3eac4

Change-Id: I6ad790165504b15373184270d0f0840a56253e49
This commit is contained in:
Rajat Kumar 2020-04-02 03:34:18 +00:00 • committed by Automerger Merge Worker
commit dc9da8722e
2 changed files with 9 additions and 1 deletions

View file

@ -2461,7 +2461,7 @@ IA_ERRORCODE ixheaacd_dec_execute(
p_state_enhaacplus_dec,
(ia_sampling_rate_info_struct *)&p_obj_exhaacplus_dec->aac_tables
.pstr_huffmann_tables->str_sample_rate_info[0]);
if (result < 0) return result;
if (result) return result;
if (!p_state_enhaacplus_dec->latm_initialized) {
p_state_enhaacplus_dec->sampling_rate =
p_state_enhaacplus_dec->latm_struct_element.layer_info[0][0]

View file

@ -488,6 +488,8 @@ WORD32 ixheaacd_ga_hdr_dec(ia_aac_dec_state_struct *aac_state_struct,
WORD32 tmp;
WORD32 cnt_bits = it_bit_buff->cnt_bits;
WORD32 dummy = 0;
UWORD32 aot_init;
ia_audio_specific_config_struct *pstr_audio_specific_config;
memset(aac_state_struct->ia_audio_specific_config, 0,
@ -501,6 +503,8 @@ WORD32 ixheaacd_ga_hdr_dec(ia_aac_dec_state_struct *aac_state_struct,
aac_state_struct->p_config->str_prog_config.alignment_bits =
it_bit_buff->bit_pos;
aot_init = aac_state_struct->audio_object_type;
aac_state_struct->audio_object_type = ixheaacd_read_bits_buf(it_bit_buff, 5);
if (aac_state_struct->audio_object_type == 31) {
@ -541,6 +545,10 @@ WORD32 ixheaacd_ga_hdr_dec(ia_aac_dec_state_struct *aac_state_struct,
ixheaacd_read_bits_buf(it_bit_buff, 5);
}
if (aac_state_struct->ui_init_done) {
if (aac_state_struct->audio_object_type != aot_init) return IA_FATAL_ERROR;
}
if (((aac_state_struct->audio_object_type >= AOT_AAC_MAIN &&
aac_state_struct->audio_object_type <= AOT_AAC_LTP) ||
aac_state_struct->audio_object_type == AOT_AAC_SCAL ||