[Sound-open-firmware] [PATCH] comp: mixer: calculate frame and period bytes in params().
Liam Girdwood
liam.r.girdwood at linux.intel.com
Thu Aug 24 23:15:09 CEST 2017
TODO: need to check all sources for params.
Signed-off-by: Liam Girdwood <liam.r.girdwood at linux.intel.com>
---
src/audio/mixer.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/audio/mixer.c b/src/audio/mixer.c
index 372d59f..60177af 100644
--- a/src/audio/mixer.c
+++ b/src/audio/mixer.c
@@ -127,8 +127,19 @@ static int mixer_params(struct comp_dev *dev)
trace_mixer("par");
+ /* calculate frame size based on config */
+ dev->frame_bytes = comp_frame_bytes(dev);
+ if (dev->frame_bytes == 0) {
+ trace_mixer_error("mx1");
+ return -EINVAL;
+ }
+
/* calculate period size based on config */
md->period_bytes = dev->frames * dev->frame_bytes;
+ if (md->period_bytes == 0) {
+ trace_mixer_error("mx2");
+ return -EINVAL;
+ }
return 0;
}
--
2.11.0
More information about the Sound-open-firmware
mailing list