mirror of https://github.com/thesofproject/sof.git
mixer: make sure mixer does not overflow sources.
Add protection to make sure we don't overflow the number of sources. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
parent
3eb7a9e9d7
commit
d26937b3b7
|
@ -233,6 +233,10 @@ static int mixer_copy(struct comp_dev *dev)
|
|||
/* only mix the sources with the same state with mixer */
|
||||
if (source->source->state == dev->state)
|
||||
sources[num_mix_sources++] = source;
|
||||
|
||||
/* too many sources ? */
|
||||
if (num_mix_sources == PLATFORM_MAX_STREAMS - 1)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* dont have any work if all sources are inactive */
|
||||
|
|
Loading…
Reference in New Issue