Source Code Project Mantis - FSSCP
View Issue Details
0002535FSSCPsoundpublic2011-11-04 09:282011-11-05 03:08
Reporterm_m 
Assigned ToEchelon9 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version3.6.13 
Target VersionFixed in Version3.6.14 
Summary0002535: Game crashes in player select menu
DescriptionThe game crashes when the game switches to state GS_STATE_INITIAL_PLAYER_SELECT (see stacktrace below) as it tries to index the Sounds vector with an invalid index when it tries to play a looping sound (see sound.cpp, line 801).
This can be fixed by setting the game_snd id to -1 in its constructor so the vector doesn't get indexed, patch is attached.
Additional InformationStacktrace as generateded by Visual Studio:
> fs2_open_3_6_13d_INF_SSE2.exe!snd_play_looping(game_snd * gs=0x0c23f060, float pan=0.00000000, int start_loop=-1, int stop_loop=-1, float vol_scale=1.0000000, int scriptingUpdateVolume=1) Line 801 + 0x17 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!main_hall_start_ambient() Line 1482 + 0x34 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!player_select_init() Line 230 C++
     fs2_open_3_6_13d_INF_SSE2.exe!game_enter_state(int old_state=0, int new_state=37) Line 6378 C++
     fs2_open_3_6_13d_INF_SSE2.exe!gameseq_set_state(int new_state=37, int override=0) Line 282 + 0x18 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!game_process_event(int current_state=0, int event=49) Line 5438 + 0x9 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!gameseq_process_events() Line 397 + 0x19 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!game_main(char * cmdline=0x00303452) Line 7084 + 0x5 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!WinMain(HINSTANCE__ * hInst=0x00400000, HINSTANCE__ * hPrev=0x00000000, char * szCmdLine=0x00303452, int nCmdShow=1) Line 7153 + 0x9 bytes C++
     fs2_open_3_6_13d_INF_SSE2.exe!__tmainCRTStartup() Line 275 + 0x2c bytes C
     fs2_open_3_6_13d_INF_SSE2.exe!WinMainCRTStartup() Line 189 C
     kernel32.dll!7588ed6c()
     [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
     ntdll.dll!777537f5()
     ntdll.dll!777537c8()
TagsNo tags attached.
Attached Filespatch sound.h.patch (393) 2011-11-04 09:28
http://scp.indiegames.us/mantis/file_download.php?file_id=1729&type=bug
patch gameSndStruct.svn.patch (1,718) 2011-11-04 13:40
http://scp.indiegames.us/mantis/file_download.php?file_id=1730&type=bug

Notes
(0012925)
Eli2   
2011-11-04 13:41   
I had this change in a separate commit here on disk.
:/ i hope this fixes all problems.
(0012928)
Echelon9   
2011-11-05 03:08   
Thanks both.
Fixed in http://svn.icculus.org/fs2open?view=rev&revision=7945

Issue History
2011-11-04 09:28m_mNew Issue
2011-11-04 09:28m_mFile Added: sound.h.patch
2011-11-04 13:40Eli2File Added: gameSndStruct.svn.patch
2011-11-04 13:41Eli2Note Added: 0012925
2011-11-05 03:08Echelon9Statusnew => assigned
2011-11-05 03:08Echelon9Assigned To => Echelon9
2011-11-05 03:08Echelon9Note Added: 0012928
2011-11-05 03:08Echelon9Statusassigned => resolved
2011-11-05 03:08Echelon9Fixed in Version => 3.6.14
2011-11-05 03:08Echelon9Resolutionopen => fixed