From efe9dd844f8cc8b6d92a041e7151add548cf2e9d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 21 Apr 2003 01:24:53 +0000 Subject: [PATCH] fix the segfault on starting a map only to die from file handle starvation :P --- libs/audio/renderer/snd_dma.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/audio/renderer/snd_dma.c b/libs/audio/renderer/snd_dma.c index 8ae61488c..04453c80f 100644 --- a/libs/audio/renderer/snd_dma.c +++ b/libs/audio/renderer/snd_dma.c @@ -523,6 +523,10 @@ SND_UpdateAmbientSounds (void) for (ambient_channel = 0; ambient_channel < NUM_AMBIENTS; ambient_channel++) { chan = &channels[ambient_channel]; + if (!ambient_sfx[ambient_channel]) { + chan->sfx = 0; + continue; + } chan->sfx = ambient_sfx[ambient_channel]->open (ambient_sfx[ambient_channel]); vol = ambient_level->value * l->ambient_sound_level[ambient_channel];