aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortripti-tiwari <94428629+tripti-tiwari@users.noreply.github.com>2023-12-18 16:43:37 +0530
committerGitHub <noreply@github.com>2023-12-18 16:43:37 +0530
commit9b21ecaae12a6a1a57afb902257b910c9b083076 (patch)
tree0569e75e71e3bc1459faa879ec213c9e8f058691
parentb5c3233a7a0aeb3c21c18429aa911cf0ab00e3c4 (diff)
parent2624ae15b4d115a02623ec9f231237c429337a02 (diff)
downloadlibxaac-9b21ecaae12a6a1a57afb902257b910c9b083076.tar.gz
Merge pull request #70 from ittiam-systems/decoder_bug_fixes
Decoder Bug Fixes
-rw-r--r--decoder/ixheaacd_headerdecode.c5
-rw-r--r--decoder/ixheaacd_init_config.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/decoder/ixheaacd_headerdecode.c b/decoder/ixheaacd_headerdecode.c
index 41c4594..03fb067 100644
--- a/decoder/ixheaacd_headerdecode.c
+++ b/decoder/ixheaacd_headerdecode.c
@@ -535,6 +535,11 @@ WORD32 ixheaacd_ga_hdr_dec(ia_aac_dec_state_struct *aac_state_struct,
aac_state_struct->ch_config = ixheaacd_read_bits_buf(it_bit_buff, 4);
+ if (aac_state_struct->audio_object_type == AOT_USAC &&
+ ((aac_state_struct->ch_config >= 3) && (aac_state_struct->ch_config != 8))) {
+ return IA_XHEAAC_DEC_INIT_FATAL_DEC_INIT_FAIL;
+ }
+
pstr_audio_specific_config->channel_configuration =
aac_state_struct->ch_config;
diff --git a/decoder/ixheaacd_init_config.c b/decoder/ixheaacd_init_config.c
index d5373a8..f58b72e 100644
--- a/decoder/ixheaacd_init_config.c
+++ b/decoder/ixheaacd_init_config.c
@@ -644,6 +644,9 @@ WORD32 ixheaacd_config(ia_bit_buf_struct *it_bit_buff, ia_usac_config_struct *ps
if (BS_MAX_NUM_OUT_CHANNELS < pstr_usac_conf->num_out_channels) {
return IA_XHEAAC_DEC_INIT_FATAL_STREAM_CHAN_GT_MAX;
}
+ if (pstr_usac_conf->num_out_channels < 1) {
+ return IA_XHEAAC_DEC_INIT_FATAL_DEC_INIT_FAIL;
+ }
for (i = 0; i < pstr_usac_conf->num_out_channels; i++)
pstr_usac_conf->output_channel_pos[i] =
ixheaacd_read_bits_buf(it_bit_buff, 5);