post_proc: fix mul-overflow
Fix mul-overflow due to uninitialized value being used.
Change-Id: I97d1f63534aa6f5ac28357bf489796607747b162
diff --git a/post_proc/effect_api.c b/post_proc/effect_api.c
index 4101647..a07de20 100644
--- a/post_proc/effect_api.c
+++ b/post_proc/effect_api.c
@@ -515,11 +515,11 @@
eq->per_band_cfg[i].freq_millihertz = band_freq_list[i] * 1000;
eq->per_band_cfg[i].gain_millibels = band_gain_list[i] * 100;
eq->per_band_cfg[i].quality_factor = Q8_UNITY;
- }
-
#ifdef DTS_EAGLE
update_effects_node(PCM_DEV_ID, EFFECT_TYPE_EQ, EFFECT_SET_PARAM, EFFECT_NO_OP, EFFECT_NO_OP, i, band_gain_list[i] * 100);
#endif
+ }
+
}
static int eq_send_params(eff_mode_t mode, void *ctl, struct eq_params *eq,
diff --git a/post_proc/equalizer.c b/post_proc/equalizer.c
index ed16f12..a2e69b0 100644
--- a/post_proc/equalizer.c
+++ b/post_proc/equalizer.c
@@ -517,6 +517,8 @@
set_config(context, &context->config);
eq_ctxt->hw_acc_fd = -1;
+ for (int i = 0; i < NUM_EQ_BANDS; i++)
+ eq_ctxt->band_levels[i] = 0;
memset(&(eq_ctxt->offload_eq), 0, sizeof(struct eq_params));
offload_eq_set_preset(&(eq_ctxt->offload_eq), INVALID_PRESET);
enable_gcov();