aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShashank Pathmudi <shashank.pathmudi@ittiam.com>2023-11-27 12:23:49 +0530
committersandeshvenkatesh <89826624+sandeshvenkatesh@users.noreply.github.com>2023-11-27 13:56:59 +0530
commitcc7ce80ec3b6044b26b851c98a7a10952f0e22f8 (patch)
treefcb4f3bfd6f21ad72392ba1d877dd92e52df21de
parent9b18e51b8af534af96557fd665497e948d494178 (diff)
downloadlibxaac-cc7ce80ec3b6044b26b851c98a7a10952f0e22f8.tar.gz
Fix for write access violation and divide by zero in MPS module
-rw-r--r--decoder/ixheaacd_aacdecoder.c6
-rw-r--r--decoder/ixheaacd_api.c7
2 files changed, 6 insertions, 7 deletions
diff --git a/decoder/ixheaacd_aacdecoder.c b/decoder/ixheaacd_aacdecoder.c
index a5b958f..449c984 100644
--- a/decoder/ixheaacd_aacdecoder.c
+++ b/decoder/ixheaacd_aacdecoder.c
@@ -1120,8 +1120,10 @@ WORD32 ixheaacd_extension_payload(ia_bit_buf_struct *it_bit_buff, WORD32 *cnt,
ixheaacd_read_bits_buf(it_bit_buff, 2);/*anc_type*/
ixheaacd_read_bits_buf(it_bit_buff, 2);/*anc_start_stop*/
- err = ixheaacd_ld_mps_frame_parsing(self, it_bit_buff);
- if (err) return err;
+ if (self->ldmps_config.ldmps_present_flag == 1) {
+ err = ixheaacd_ld_mps_frame_parsing(self, it_bit_buff);
+ if (err) return err;
+ }
*cnt = it_bit_buff->cnt_bits;
break;
diff --git a/decoder/ixheaacd_api.c b/decoder/ixheaacd_api.c
index 9f60ef7..066bf9d 100644
--- a/decoder/ixheaacd_api.c
+++ b/decoder/ixheaacd_api.c
@@ -2452,11 +2452,8 @@ IA_ERRORCODE ixheaacd_dec_init(
(p_obj_exhaacplus_dec->p_state_aac->audio_object_type ==
AOT_ER_AAC_ELD)))
p_obj_exhaacplus_dec->aac_config.flag_to_stereo = 1;
- if (p_state_enhaacplus_dec->mps_dec_handle.ldmps_config
- .ldmps_present_flag == 1) {
- copy_qmf_to_ldmps(&p_obj_exhaacplus_dec->p_state_aac->mps_dec_handle,
- p_state_enhaacplus_dec->sbr_persistent_mem_v);
- }
+ copy_qmf_to_ldmps(&p_obj_exhaacplus_dec->p_state_aac->mps_dec_handle,
+ p_state_enhaacplus_dec->sbr_persistent_mem_v);
if (p_state_enhaacplus_dec->audio_object_type == AOT_AAC_LC &&
p_state_enhaacplus_dec->ui_mps_out_bytes != 0) {
p_state_enhaacplus_dec->heaac_mps_handle.heaac_mps_present = 1;