From 3f269033bebd2189bf2cc415925fcd5ed3e4595c Mon Sep 17 00:00:00 2001 From: Allanis Date: Fri, 21 Jun 2013 22:02:21 +0100 Subject: [PATCH] [Fix] Segfault when running Lephisto muted. --- src/sound.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sound.c b/src/sound.c index 51dbcbc..9ab05cc 100644 --- a/src/sound.c +++ b/src/sound.c @@ -550,6 +550,8 @@ void voice_update(alVoice* voice, double px, double py, double vx, double vy) { // Changes the voice's buffer. void voice_buffer(alVoice* voice, const ALuint buffer, const unsigned int flags) { + if(voice == NULL) return; + voice->buffer = buffer; voice_parseFlags(voice, flags); @@ -561,6 +563,8 @@ void voice_buffer(alVoice* voice, const ALuint buffer, const unsigned int flags) // Stop playing sound. void voice_stop(alVoice* voice) { + if(voice == NULL) return; + soundLock(); if(voice->source != 0) alSourceStop(voice->source);