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);