Skip to content

Commit

Permalink
Audio: Crossover: Fix mistake in check for number of bands
Browse files Browse the repository at this point in the history
The check needs to be for or, the and condition is never met.
With e.g. num_sinks = 1 the index to function map became -1
that returned an invalid function.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
  • Loading branch information
singalsu authored and cujomalainey committed Aug 24, 2023
1 parent 9359f57 commit 6403e62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/include/sof/audio/crossover/crossover.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ extern const size_t crossover_split_fncount;
*/
static inline crossover_split crossover_find_split_func(int32_t num_sinks)
{
if (num_sinks < CROSSOVER_2WAY_NUM_SINKS &&
if (num_sinks < CROSSOVER_2WAY_NUM_SINKS ||
num_sinks > CROSSOVER_4WAY_NUM_SINKS)
return NULL;
// The functions in the map are offset by 2 indices.
Expand Down

0 comments on commit 6403e62

Please sign in to comment.