summaryrefslogtreecommitdiff
path: root/src/client/snd_openal.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/snd_openal.c')
-rw-r--r--src/client/snd_openal.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/client/snd_openal.c b/src/client/snd_openal.c
index dc067be0..dc1cf90b 100644
--- a/src/client/snd_openal.c
+++ b/src/client/snd_openal.c
@@ -197,6 +197,20 @@ static sfxHandle_t S_AL_BufferFind(const char *filename)
sfxHandle_t sfx = -1;
int i;
+ if ( !filename ) {
+ Com_Error( ERR_FATAL, "Sound name is NULL" );
+ }
+
+ if ( !filename[0] ) {
+ Com_Printf( S_COLOR_YELLOW "WARNING: Sound name is empty\n" );
+ return 0;
+ }
+
+ if ( strlen( filename ) >= MAX_QPATH ) {
+ Com_Printf( S_COLOR_YELLOW "WARNING: Sound name is too long: %s\n", filename );
+ return 0;
+ }
+
for(i = 0; i < numSfx; i++)
{
if(!Q_stricmp(knownSfx[i].filename, filename))