summaryrefslogtreecommitdiff
path: root/src/i_sdlsound.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/i_sdlsound.c')
-rw-r--r--src/i_sdlsound.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/i_sdlsound.c b/src/i_sdlsound.c
index 2a1d83bc..5cacbc1e 100644
--- a/src/i_sdlsound.c
+++ b/src/i_sdlsound.c
@@ -826,7 +826,7 @@ static void I_SDL_UpdateSoundParams(int handle, int vol, int sep)
{
int left, right;
- if (!sound_initialized)
+ if (!sound_initialized || handle < 0 || handle >= NUM_CHANNELS)
{
return;
}
@@ -869,7 +869,7 @@ static int I_SDL_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, int sep)
{
allocated_sound_t *snd;
- if (!sound_initialized)
+ if (!sound_initialized || channel < 0 || channel >= NUM_CHANNELS)
{
return -1;
}
@@ -901,9 +901,9 @@ static int I_SDL_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, int sep)
return channel;
}
-static void I_SDL_StopSound (int handle)
+static void I_SDL_StopSound(int handle)
{
- if (!sound_initialized)
+ if (!sound_initialized || handle < 0 || handle >= NUM_CHANNELS)
{
return;
}
@@ -919,7 +919,7 @@ static void I_SDL_StopSound (int handle)
static boolean I_SDL_SoundIsPlaying(int handle)
{
- if (handle < 0)
+ if (!sound_initialized || handle < 0 || handle >= NUM_CHANNELS)
{
return false;
}