[Fix] Segfault when running Lephisto muted.

This commit is contained in:
Allanis 2013-06-21 22:02:21 +01:00
parent 87514e63a7
commit 3f269033be

View File

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