[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;
|
||||
int system_sample_rate = hdsp->system_sample_rate;
|
||||
|
||||
if (!dds_value)
|
||||
return 0;
|
||||
|
||||
n = DDS_NUMERATOR;
|
||||
/*
|
||||
* dds_value = n / rate
|
||||
|
Loading…
Reference in New Issue
Block a user