The s1.x_rptr, s1.y_wptr, and s2.y_wptr might be used as uninitialized. Also remove some obsolete code lines.
Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com --- src/audio/src.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-)
diff --git a/src/audio/src.c b/src/audio/src.c index 7a86a54..66cbbc1 100644 --- a/src/audio/src.c +++ b/src/audio/src.c @@ -168,6 +168,9 @@ static void src_2s_s32_default(struct comp_dev *dev, s2.y_size = sink->alloc_size; s2.y_inc = nch;
+ s1.x_rptr = src + nch - 1; + s2.y_wptr = dest + nch - 1; + for (j = 0; j < nch; j++) { s = &cd->src[j]; /* Point to src[] for this channel */ s1.x_rptr = src++; @@ -228,6 +231,8 @@ static void src_1s_s32_default(struct comp_dev *dev, s1.y_end_addr = sink->end_addr; s1.y_size = sink->alloc_size; s1.y_inc = nch; + s1.x_rptr = src + nch - 1; + s1.y_wptr = dest + nch - 1;
for (j = 0; j < nch; j++) { s = &cd->src[j]; /* Point to src for this channel */ @@ -268,18 +273,11 @@ static struct comp_dev *src_new(struct sof_ipc_comp *comp)
cd = rmalloc(RZONE_RUNTIME, RFLAGS_NONE, sizeof(*cd)); if (cd == NULL) { -#if SRC_SOF == 1 - rfree(dev); -#else rfree(dev); -#endif return NULL; }
comp_set_drvdata(dev, cd); -#if SRC_SOF == 0 - -#endif
cd->delay_lines = NULL; cd->src_func = src_2s_s32_default; @@ -295,21 +293,12 @@ static void src_free(struct comp_dev *dev)
trace_src("SFr");
-#if SRC_SOF == 1 - /* Free dynamically reserved buffers for SRC algorithm */ - if (cd->delay_lines != NULL) - rfree(cd->delay_lines); - - rfree(cd); - rfree(dev); -#else /* Free dynamically reserved buffers for SRC algorithm */ if (cd->delay_lines != NULL) rfree(cd->delay_lines);
rfree(cd); rfree(dev); -#endif }
/* set component audio stream parameters */