From dd83cbdc25c1b373d5541ac763f258f1673df266 Mon Sep 17 00:00:00 2001 From: MAN-AT-ARMS Date: Tue, 9 Sep 2014 11:30:23 -0400 Subject: [PATCH] Fix possible division by zero in S_PaintChannelFrom16_altivec --- code/client/snd_mix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/client/snd_mix.c b/code/client/snd_mix.c index 1efe1e3d..943c50fa 100644 --- a/code/client/snd_mix.c +++ b/code/client/snd_mix.c @@ -236,6 +236,10 @@ static void S_PaintChannelFrom16_altivec( channel_t *ch, const sfx_t *sc, int co short *samples; float ooff, fdata[2], fdiv, fleftvol, frightvol; + if (sc->soundChannels <= 0) { + return; + } + samp = &paintbuffer[ bufferOffset ]; if (ch->doppler) {