aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Essick <essick@google.com>2019-02-24 23:55:19 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-02-24 23:55:19 +0000
commite5eb426d1a790e3664c75a6a697388645fe600af (patch)
tree365579660a91a32a04de0f35ff26d4c87f0f174c
parent468eb7debe3c7bd8eb8459fa98f78f0272ef3324 (diff)
parent8913b0b1264ee6402066bb40a7c31b929cede7db (diff)
downloadlibxaac-e5eb426d1a790e3664c75a6a697388645fe600af.tar.gz
Merge changes from topic "xaac_b112709994"
* changes: Fix for global buffer overflow in scale factor process function Fix for NPD in ixheaacd_applysbr
-rw-r--r--decoder/ixheaacd_api.c19
-rw-r--r--decoder/ixheaacd_channel.c3
-rw-r--r--decoder/ixheaacd_headerdecode.c3
3 files changed, 17 insertions, 8 deletions
diff --git a/decoder/ixheaacd_api.c b/decoder/ixheaacd_api.c
index 2efad04..2652d27 100644
--- a/decoder/ixheaacd_api.c
+++ b/decoder/ixheaacd_api.c
@@ -1413,17 +1413,22 @@ IA_ERRORCODE ixheaacd_dec_init(
return IA_NO_ERROR;
}
+ memset(&(p_state_enhaacplus_dec->eld_specific_config), 0,
+ sizeof(ia_eld_specific_config_struct));
return_val = ixheaacd_aac_headerdecode(
p_obj_exhaacplus_dec, (UWORD8 *)in_buffer, &header_bytes_consumed,
aac_persistent_mem->str_aac_decoder.pstr_aac_tables
->pstr_huffmann_tables);
-
- memcpy(sbr_persistent_mem->str_sbr_dec_inst.pstr_sbr_header[0],
- &p_obj_exhaacplus_dec->p_state_aac->str_sbr_config,
- sizeof(ia_sbr_header_data_struct));
- memcpy(sbr_persistent_mem->str_sbr_dec_inst.pstr_sbr_header[1],
- &p_obj_exhaacplus_dec->p_state_aac->str_sbr_config,
- sizeof(ia_sbr_header_data_struct));
+ if (p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_LD ||
+ p_state_enhaacplus_dec->audio_object_type == AOT_ER_AAC_ELD) {
+ *sbr_persistent_mem->str_sbr_dec_inst.pstr_sbr_header[0] =
+ p_obj_exhaacplus_dec->p_state_aac->str_sbr_config;
+ *sbr_persistent_mem->str_sbr_dec_inst.pstr_sbr_header[1] =
+ p_obj_exhaacplus_dec->p_state_aac->str_sbr_config;
+ } else {
+ memset(&(p_state_enhaacplus_dec->eld_specific_config), 0,
+ sizeof(ia_eld_specific_config_struct));
+ }
if (return_val < 0) {
if (return_val ==
diff --git a/decoder/ixheaacd_channel.c b/decoder/ixheaacd_channel.c
index 3a2fea6..e452f37 100644
--- a/decoder/ixheaacd_channel.c
+++ b/decoder/ixheaacd_channel.c
@@ -578,7 +578,8 @@ VOID ixheaacd_channel_pair_process(
void *self_ptr) {
WORD32 channel;
ia_aac_decoder_struct *self = self_ptr;
- if (aac_spect_data_resil_flag) {
+ if (aac_spect_data_resil_flag &&
+ ((object_type == AOT_ER_AAC_LD) || (object_type == AOT_ER_AAC_ELD))) {
for (channel = 0; channel < num_ch; channel++) {
ixheaacd_cblock_inv_quant_spect_data(ptr_aac_dec_channel_info[channel],
ptr_aac_tables);
diff --git a/decoder/ixheaacd_headerdecode.c b/decoder/ixheaacd_headerdecode.c
index c632864..5e809ec 100644
--- a/decoder/ixheaacd_headerdecode.c
+++ b/decoder/ixheaacd_headerdecode.c
@@ -496,6 +496,9 @@ WORD32 ixheaacd_ga_hdr_dec(ia_aac_dec_state_struct *aac_state_struct,
memset(aac_state_struct->ia_audio_specific_config, 0,
sizeof(ia_audio_specific_config_struct));
+ memset(&(aac_state_struct->eld_specific_config), 0,
+ sizeof(ia_eld_specific_config_struct));
+
pstr_audio_specific_config = aac_state_struct->ia_audio_specific_config;
aac_state_struct->p_config->str_prog_config.alignment_bits =