[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:
Takashi Iwai 2007-10-16 14:26:32 +02:00 committed by Jaroslav Kysela
parent ea045ee4d3
commit 2a3988f6d2
1 changed files with 3 additions and 0 deletions

View File

@ -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