EQ: Fix IPC data copy size in new() method in IIR and FIR

The used memcpy_s() has wrong size for destination. It causes the
prepare() method to fail later in component life cycle into sink buffer
resize due to zero config->periods_sink value. This patch fixes the
fail of pipeline instantantion with IIR and FIR EQ components.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This commit is contained in:
Seppo Ingalsuo 2019-03-27 12:37:25 +02:00 committed by Tomasz Lauda
parent 742f83ba2f
commit a10e69d2f1
2 changed files with 8 additions and 4 deletions

View File

@ -376,6 +376,7 @@ static struct comp_dev *eq_fir_new(struct sof_ipc_comp *comp)
{ {
struct comp_dev *dev; struct comp_dev *dev;
struct comp_data *cd; struct comp_data *cd;
struct sof_ipc_comp_process *fir;
struct sof_ipc_comp_process *ipc_fir struct sof_ipc_comp_process *ipc_fir
= (struct sof_ipc_comp_process *)comp; = (struct sof_ipc_comp_process *)comp;
size_t bs = ipc_fir->size; size_t bs = ipc_fir->size;
@ -402,8 +403,9 @@ static struct comp_dev *eq_fir_new(struct sof_ipc_comp *comp)
if (!dev) if (!dev)
return NULL; return NULL;
err = memcpy_s(&dev->comp, sizeof(dev->comp), comp, fir = (struct sof_ipc_comp_process *)&dev->comp;
sizeof(struct sof_ipc_comp_process)); err = memcpy_s(fir, sizeof(*fir),
ipc_fir, sizeof(struct sof_ipc_comp_process));
cd = rzalloc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM, sizeof(*cd)); cd = rzalloc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM, sizeof(*cd));
if (!cd) { if (!cd) {

View File

@ -481,6 +481,7 @@ static struct comp_dev *eq_iir_new(struct sof_ipc_comp *comp)
{ {
struct comp_dev *dev; struct comp_dev *dev;
struct comp_data *cd; struct comp_data *cd;
struct sof_ipc_comp_process *iir;
struct sof_ipc_comp_process *ipc_iir = struct sof_ipc_comp_process *ipc_iir =
(struct sof_ipc_comp_process *)comp; (struct sof_ipc_comp_process *)comp;
size_t bs = ipc_iir->size; size_t bs = ipc_iir->size;
@ -507,8 +508,9 @@ static struct comp_dev *eq_iir_new(struct sof_ipc_comp *comp)
if (!dev) if (!dev)
return NULL; return NULL;
err = memcpy_s(&dev->comp, sizeof(dev->comp), iir = (struct sof_ipc_comp_process *)&dev->comp;
comp, sizeof(struct sof_ipc_comp_process)); err = memcpy_s(iir, sizeof(*iir),
ipc_iir, sizeof(struct sof_ipc_comp_process));
cd = rzalloc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM, sizeof(*cd)); cd = rzalloc(RZONE_RUNTIME, SOF_MEM_CAPS_RAM, sizeof(*cd));
if (!cd) { if (!cd) {