From 505a57d32d8c49ddfeca928ed988ba3b279aff3e Mon Sep 17 00:00:00 2001 From: Tanu Kaskinen Date: Fri, 15 Feb 2013 21:24:36 +0200 Subject: [PATCH] echo-cancel: Fix uninitialized variable dotp_xf_xf of AEC struct Initialize the variable to zero by using pa_xnew0() instead of pa_xnew(). This also allows us to remove a bunch of other zero initialization statements. Reported-by: Peter Meerwald --- src/modules/echo-cancel/adrian-aec.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/modules/echo-cancel/adrian-aec.c b/src/modules/echo-cancel/adrian-aec.c index baf59cf..67a2794 100644 --- a/src/modules/echo-cancel/adrian-aec.c +++ b/src/modules/echo-cancel/adrian-aec.c @@ -70,13 +70,8 @@ static REAL dotp_sse(REAL a[], REAL b[]) AEC* AEC_init(int RATE, int have_vector) { - AEC *a = pa_xnew(AEC, 1); - a->hangover = 0; - memset(a->x, 0, sizeof(a->x)); - memset(a->xf, 0, sizeof(a->xf)); - memset(a->w_arr, 0, sizeof(a->w_arr)); + AEC *a = pa_xnew0(AEC, 1); a->j = NLMS_EXT; - a->delta = 0.0f; AEC_setambient(a, NoiseFloor); a->dfast = a->dslow = M75dB_PCM; a->xfast = a->xslow = M80dB_PCM; @@ -90,8 +85,6 @@ AEC* AEC_init(int RATE, int have_vector) a->aes_y2 = M0dB; a->fdwdisplay = -1; - a->dumpcnt = 0; - memset(a->ws, 0, sizeof(a->ws)); if (have_vector) { /* Get a 16-byte aligned location */ -- 2.7.4