aboutsummaryrefslogtreecommitdiff
path: root/decoder/ixheaacd_lpc.c
diff options
context:
space:
mode:
authorHarish Mahendrakar <harish.mahendrakar@ittiam.com>2018-05-09 14:23:00 -0700
committerRay Essick <essick@google.com>2018-06-05 13:04:22 -0700
commit8eb646f89b94cf6d0aa26e5bca39ba083a554965 (patch)
tree11bfb08fb1722b0b435c453aed777ab94687c31f /decoder/ixheaacd_lpc.c
parent36ef96da451b4257b77e841b36d4dcbcb250500d (diff)
downloadlibxaac-8eb646f89b94cf6d0aa26e5bca39ba083a554965.tar.gz
Collected Cleanups from Ittiam
Test: CTS android.media.cts.DecoderTest{AacDrc,XheAac} Added __ARM_NEON__ check to generic function selector Bug: 80432407 Change-Id: I66c7879fda1369da88ccaea5f8792ea54657cdaf Added support to build for mips Bug: 80432286 Change-Id: I908029bbaddd3c1fbc39be1192926b56d981576e Add optimized versions for qmf_dec for armv7 and armv8 Separating common functions and platform specific functions in ixheaacd_qmf_dec.c. Platform specific functions are moved to qmf_dec in armv7, armv8 and generic folder. Bug: 80431870 Change-Id: I860cb79a1870e228d2108b7915418e1c003cefc5 Fixes for crashes reported by Fuzzer tool Bug: 109697676 Change-Id: I862fc054b99ee9d427d20596bc8d2e85522a7188
Diffstat (limited to 'decoder/ixheaacd_lpc.c')
-rw-r--r--decoder/ixheaacd_lpc.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/decoder/ixheaacd_lpc.c b/decoder/ixheaacd_lpc.c
index 0d753a6..ca0546f 100644
--- a/decoder/ixheaacd_lpc.c
+++ b/decoder/ixheaacd_lpc.c
@@ -413,7 +413,10 @@ WORD32 ixheaacd_lpd_dec(ia_usac_data_struct *usac_data,
} else {
fac_length = len_subfrm / 2;
}
-
+ if((pstr_td_frame_data->fac_data[0] < 0) || (pstr_td_frame_data->fac_data[0] > 128))
+ {
+ return -1;
+ }
gain = ixheaacd_pow_10_i_by_128[pstr_td_frame_data->fac_data[0]];
memcpy(ptr_scratch, &pstr_td_frame_data->fac_data[0],
@@ -699,6 +702,14 @@ WORD32 ixheaacd_lpd_bpf_fix(ia_usac_data_struct *usac_data, WORD32 is_short_flag
for (i = 0; i < num_subfr_by2 + 2; i++) {
tp = pitch[i];
+ if((i * LEN_SUBFR + MAX_PITCH) < tp)
+ {
+ return -1;
+ }
+ else if((i * LEN_SUBFR + MAX_PITCH - tp) >= 1883)
+ {
+ return -1;
+ }
if (pitch_gain[i] > 0.0f) {
synth_corr = 0.0f, synth_energy = 1e-6f;
for (k = 0; k < LEN_SUBFR; k++) {