Fix for crash due to un-initailized variables in drc module

Nested loop used wrong subscript in inner loop, leading to bad
iteration count and haphazard clearing of data structure.

Bug: 113885537
Test: vendor
Change-Id: Ia9cb53205f4e91ee99268202114fc2001eae2de3
This commit is contained in:
Ramesh Katuri 2018-09-18 12:04:31 +05:30 committed by Ray Essick
parent 8630b598a9
commit 988f5bd17c

View file

@ -148,25 +148,25 @@ IA_ERRORCODE impd_init_drc_decode_post_config(
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k]
.buf_interpolation_count = drc_instruction_str->gain_element_count;
for (i = 0;
i < p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
i < p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k]
.buf_interpolation_count;
i++) {
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k]
.buf_interpolation[i]
.str_node.time = 0;
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k]
.buf_interpolation[i]
.prev_node.time = -1;
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k]
.buf_interpolation[i]
.str_node.loc_db_gain = 0.0f;
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k]
.buf_interpolation[i]
.str_node.slope = 0.0f;
for (j = 0; j < 2 * AUDIO_CODEC_FRAME_SIZE_MAX + MAX_SIGNAL_DELAY;
j++) {
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[i]
p_drc_gain_dec_structs->drc_gain_buffers.pstr_gain_buf[k]
.buf_interpolation[i]
.lpcm_gains[j] = 1.f;
}