don't infinite loop if a sound has total_length 0
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Apr 2011 16:00:21 +0000 (16:00 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 10 Apr 2011 16:00:21 +0000 (16:00 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11046 d7cf8633-e32d-0410-b094-e92efae38249

snd_mix.c

index 9094ce6..05abc83 100644 (file)
--- a/snd_mix.c
+++ b/snd_mix.c
@@ -503,6 +503,8 @@ void S_MixToBuffer(void *stream, unsigned int bufferframes)
                                continue;
                        if (ch->flags & CHANNELFLAG_PAUSED)
                                continue;
+                       if (!sfx->total_length)
+                               continue;
 
                        ltime = 0;
                        if (ch->pos < 0)