ALSA: synth: emux: soundfont.c: divide by zero in calc_gus_envelope_time()
[sfrench/cifs-2.6.git] / sound / synth / emux / soundfont.c
index 31a4ea94830e04358932037ca0a5bd6854624348..9b5d7010448999c74784691922b6be2617ab98d9 100644 (file)
@@ -856,6 +856,8 @@ calc_gus_envelope_time(int rate, int start, int end)
        int r, p, t;
        r = (3 - ((rate >> 6) & 3)) * 3;
        p = rate & 0x3f;
+       if (!p)
+               p = 1;
        t = end - start;
        if (t < 0) t = -t;
        if (13 > r)