From 988f5bd17c64c2efcb6e0a36c633065488ca2b79 Mon Sep 17 00:00:00 2001 From: Ramesh Katuri Date: Tue, 18 Sep 2018 12:04:31 +0530 Subject: [PATCH] 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 --- decoder/drc_src/impd_drc_gain_decoder.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/decoder/drc_src/impd_drc_gain_decoder.c b/decoder/drc_src/impd_drc_gain_decoder.c index 43ae7b2..4b48f54 100644 --- a/decoder/drc_src/impd_drc_gain_decoder.c +++ b/decoder/drc_src/impd_drc_gain_decoder.c @@ -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; }