mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
sounds.c: don't crash S_PlayMusic() if passed null pointer for 'fn'.
This may happen if no title/end music is defined from CON. Thanks to Zaxtor for the bug report. git-svn-id: https://svn.eduke32.com/eduke32@4871 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d73c7f1afe
commit
61f7c9e30f
1 changed files with 3 additions and 0 deletions
|
@ -221,6 +221,9 @@ int32_t S_PlayMusic(const char *fn, const int32_t sel)
|
|||
if (MapInfo[sel].ext_musicfn != NULL)
|
||||
alt = fn = MapInfo[sel].ext_musicfn;
|
||||
|
||||
if (fn == NULL)
|
||||
return 0;
|
||||
|
||||
testfn = (char *)Xmalloc(strlen(fn) + 6);
|
||||
strcpy(testfn, fn);
|
||||
extension = strrchr(testfn, '.');
|
||||
|
|
Loading…
Reference in a new issue