mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-10 15:21:44 +00:00
Fix segfault on device without available sound cards
In such case sound system left uninitialized and without cvars. ---- Thread 1 "quake2" received signal SIGSEGV, Segmentation fault. 0x00005555555956a1 in OGG_PlayTrack (trackNo=7) at src/client/sound/ogg.c:351 351 if((trackNo == 0) || ogg_shuffle->value) (gdb) bt #0 0x00005555555956a1 in OGG_PlayTrack (trackNo=7) at src/client/sound/ogg.c:351 #1 0x000055555557bded in CL_PrepRefresh () at src/client/cl_view.c:367 #2 0x000055555556e1a0 in CL_Precache_f () at src/client/cl_main.c:472 #3 0x00005555555a40dc in Cbuf_Execute () at src/common/cmdparser.c:229 #4 0x000055555556f0f9 in CL_Frame (packetdelta=<optimized out>, renderdelta=<optimized out>, timedelta=<optimized out>, packetframe=packetframe@entry=true, renderframe=renderframe@entry=false) at src/client/cl_main.c:803 #5 0x00005555555aa0c5 in Qcommon_Frame (usec=5) at src/common/frame.c:626 #6 0x00005555555aa48e in Qcommon_Mainloop () at src/common/frame.c:163 #7 0x00005555555aaae6 in Qcommon_Init (argc=1, argv=0x7fffffffdfa8) at src/common/frame.c:377 #8 0x000055555555e564 in main (argc=1, argv=0x7fffffffdfa8) at src/backends/unix/main.c:123 ----
This commit is contained in:
parent
dec8125e07
commit
6e80924050
1 changed files with 5 additions and 0 deletions
|
@ -324,6 +324,11 @@ OGG_Stream(void)
|
|||
void
|
||||
OGG_PlayTrack(int trackNo)
|
||||
{
|
||||
if (sound_started == SS_NOT)
|
||||
{
|
||||
return; // sound is not initialized
|
||||
}
|
||||
|
||||
// Track 0 means "stop music".
|
||||
if(trackNo == 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue