diff libaf/af_resample.c @ 28811:7c0b23a811bd

Use calloc to allocate the af_resample ring buffers, reportedly using non-zeroed buffers can cause initial noise, see -dev-eng: [PATCH]: Add missing memset after malloc in libaf/af_resample.c Wed, 4 Mar 2009 15:29:30 +0800
author reimar
date Fri, 06 Mar 2009 11:42:45 +0000
parents 54230bed6a34
children 9dd2e47e5a06
line wrap: on
line diff
--- a/libaf/af_resample.c	Fri Mar 06 11:39:13 2009 +0000
+++ b/libaf/af_resample.c	Fri Mar 06 11:42:45 2009 +0000
@@ -216,7 +216,7 @@
 
     // Create space for circular buffers
     s->xq = malloc(n->nch*sizeof(void*));
-    s->xq[0] = malloc(n->nch*2*L*af->data->bps);
+    s->xq[0] = calloc(n->nch, 2*L*af->data->bps);
     for(i=1;i<n->nch;i++)
       s->xq[i] = (uint8_t *)s->xq[i-1] + 2*L*af->data->bps;
     s->xi = 0;