aboutsummaryrefslogtreecommitdiff
path: root/sdl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sdl.cpp')
-rw-r--r--sdl.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/sdl.cpp b/sdl.cpp
index 86734039c4..479f75665e 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -499,7 +499,7 @@ MixerChannel *find_channel() {
if (!mc->_sfx_sound)
return mc;
}
- return mc;
+ return NULL;
}
@@ -514,6 +514,11 @@ bool isSfxFinished() {
void playSfxSound(void *sound, uint32 size, uint rate) {
MixerChannel *mc = find_channel();
+ if (!mc) {
+ warning("No mixer channel available");
+ return;
+ }
+
mc->_sfx_sound = sound;
mc->_sfx_pos = 0;
mc->_sfx_fp_speed = (1<<16) * rate / 22050;