Fix potential null pointer dereference in S_DefineAudioIfSupported() when passing filenames without extensions

git-svn-id: https://svn.eduke32.com/eduke32@6999 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2018-10-07 05:20:04 +00:00
parent 2cb5d948e8
commit 8b2d546774

View file

@ -5044,11 +5044,11 @@ static int32_t S_DefineAudioIfSupported(char **fn, const char *name)
#if !defined HAVE_FLAC || !defined HAVE_VORBIS
const char *extension = Bstrrchr(name, '.');
# if !defined HAVE_FLAC
if (!Bstrcasecmp(extension, ".flac"))
if (extension && !Bstrcasecmp(extension, ".flac"))
return -2;
# endif
# if !defined HAVE_VORBIS
if (!Bstrcasecmp(extension, ".ogg"))
if (extension && !Bstrcasecmp(extension, ".ogg"))
return -2;
# endif
#endif