Fix for potential stack buffer overflow in ixheaacd_lpp_tran.c

Added bound check for bw_index[patch] before using it as
index.

Bug:135077036
Test: Manual review

Change-Id: Ifb934cc2485596aa906f4a129df87b1b21d9da1f
This commit is contained in:
Rajat Kumar 2019-06-26 11:46:04 +05:30 committed by Ray Essick
parent 07a470cab1
commit 4f06fb9796

View file

@ -1091,9 +1091,11 @@ VOID ixheaacd_hf_generator(ia_sbr_hf_generator_struct *hf_generator,
continue;
}
while (high_band >=
hf_generator->pstr_settings->bw_borders[bw_index[patch]]) {
bw_index[patch] = (bw_index[patch] + 1);
while ((bw_index[patch] < MAX_NUM_PATCHES - 1) &&
(bw_index[patch] < MAX_NUM_NOISE_VALUES) &&
(high_band >=
hf_generator->pstr_settings->bw_borders[bw_index[patch]])) {
bw_index[patch]++;
}
bw = ixheaacd_extract16h(bw_array[bw_index[patch]]);