From 61f7c9e30ff4584018cd403513266549d475581b Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sun, 28 Dec 2014 22:12:40 +0000 Subject: [PATCH] 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 --- polymer/eduke32/source/sounds.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index 435fa3cc1..f73731647 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -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, '.');