diff options
author | Miika Pekkarinen <miipekk@ihme.org> | 2006-04-02 20:19:00 +0000 |
---|---|---|
committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-04-02 20:19:00 +0000 |
commit | 93b6a1d12c31a601df6b548bda81e3c40f431c47 (patch) | |
tree | 88e25758af6c67e1eb62bdc2223fc327ebf058a9 /apps/dsp.c | |
parent | ea6b4cbe4f10751087a64a13ff5d44837862cef3 (diff) | |
download | rockbox-93b6a1d12c31a601df6b548bda81e3c40f431c47.tar.gz rockbox-93b6a1d12c31a601df6b548bda81e3c40f431c47.zip |
Prevent two division by zeros and one problem causing a crash in the
mp3 metadata parser.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9438 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/dsp.c')
-rw-r--r-- | apps/dsp.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/dsp.c b/apps/dsp.c index 9cdc715109..29e103afb7 100644 --- a/apps/dsp.c +++ b/apps/dsp.c | |||
@@ -629,7 +629,10 @@ void dsp_set_eq_coefs(int band) | |||
629 | cutoff = 0xffffffff / NATIVE_FREQUENCY * (*setting++); | 629 | cutoff = 0xffffffff / NATIVE_FREQUENCY * (*setting++); |
630 | q = ((*setting++) << 16) / 10; /* 16.16 */ | 630 | q = ((*setting++) << 16) / 10; /* 16.16 */ |
631 | gain = ((*setting++) << 16) / 10; /* s15.16 */ | 631 | gain = ((*setting++) << 16) / 10; /* s15.16 */ |
632 | 632 | ||
633 | if (q == 0) | ||
634 | q = 1; | ||
635 | |||
633 | /* The coef functions assume the EMAC unit is in fractional mode */ | 636 | /* The coef functions assume the EMAC unit is in fractional mode */ |
634 | #if defined(CPU_COLDFIRE) && !defined(SIMULATOR) | 637 | #if defined(CPU_COLDFIRE) && !defined(SIMULATOR) |
635 | /* set emac unit for dsp processing, and save old macsr, we're running in | 638 | /* set emac unit for dsp processing, and save old macsr, we're running in |