From b129ed39487e34ab5df307c1f0e35949d1a5eb53 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 23 Apr 2008 23:04:00 +0000 Subject: [PATCH] - Fixed: wbstartstruct's lump name fields were only 8 characters long and not properly zero-terminated when all 8 characters were used. - Fixed: Local sound sequence definitions caused a crash because a proper NULL check was missing. SVN r933 (trunk) --- docs/rh-log.txt | 6 ++++++ src/g_level.cpp | 4 ++++ src/s_sound.cpp | 9 ++++++++- src/wi_stuff.h | 8 ++++---- src/win32/i_input.cpp | 2 +- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 70f8914b3..128bedace 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,9 @@ +April 23, 2008 (Changes by Graf Zahl) +- Fixed: wbstartstruct's lump name fields were only 8 characters long + and not properly zero-terminated when all 8 characters were used. +- Fixed: Local sound sequence definitions caused a crash because a proper + NULL check was missing. + April 22, 2008 (Changes by Graf Zahl) - Added translucent blending modes to FMultipatchTexture (not tested yet!) - Also changed all true color texture creation functions to use proper alpha diff --git a/src/g_level.cpp b/src/g_level.cpp index 25c6e26c3..efbbec909 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1857,6 +1857,10 @@ void G_DoCompleted (void) strncpy (wminfo.lname1, nextinfo->pname, 8); } } + wminfo.next[8]=0; + wminfo.lname0[8]=0; + wminfo.lname1[8]=0; + wminfo.current[8]=0; CheckWarpTransMap (wminfo.next, true); diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 514535214..7214753ff 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -366,11 +366,18 @@ void S_Start () if (level.info && level.info->soundinfo) { LocalSndInfo = level.info->soundinfo; - LocalSndSeq = level.info->sndseq; } else { LocalSndInfo = ""; + } + + if (level.info && level.info->sndseq) + { + LocalSndSeq = level.info->sndseq; + } + else + { LocalSndSeq = ""; } diff --git a/src/wi_stuff.h b/src/wi_stuff.h index e14d08dda..28be48f06 100644 --- a/src/wi_stuff.h +++ b/src/wi_stuff.h @@ -47,11 +47,11 @@ typedef struct wbstartstruct_s int finished_ep; int next_ep; - char current[8]; // [RH] Name of map just finished - char next[8]; // next level, [RH] actual map name + char current[9]; // [RH] Name of map just finished + char next[9]; // next level, [RH] actual map name - char lname0[8]; - char lname1[8]; + char lname0[9]; + char lname1[9]; int maxkills; int maxitems; diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index 13ef6b632..53973dea5 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -746,7 +746,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { SetPriorityClass (GetCurrentProcess (), IDLE_PRIORITY_CLASS); } - //SetSoundPaused (wParam); + SetSoundPaused (wParam); break; case WM_WTSSESSION_CHANGE: