Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2a3988f6 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela
Browse files

[ALSA] hdsp - Fix zero division



Fix zero-division bug in the calculation dds offset.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent ea045ee4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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