mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-15 09:34:17 +00:00
[ALSA] hdsp - Fix zero division
Fix zero-division bug in the calculation dds offset. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
ea045ee4d3
commit
2a3988f6d2
@ -3059,6 +3059,9 @@ static int hdsp_dds_offset(struct hdsp *hdsp)
|
|||||||
unsigned int dds_value = hdsp->dds_value;
|
unsigned int dds_value = hdsp->dds_value;
|
||||||
int system_sample_rate = hdsp->system_sample_rate;
|
int system_sample_rate = hdsp->system_sample_rate;
|
||||||
|
|
||||||
|
if (!dds_value)
|
||||||
|
return 0;
|
||||||
|
|
||||||
n = DDS_NUMERATOR;
|
n = DDS_NUMERATOR;
|
||||||
/*
|
/*
|
||||||
* dds_value = n / rate
|
* dds_value = n / rate
|
||||||
|
Loading…
x
Reference in New Issue
Block a user