mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-04-01 16:01:01 +00:00
Fix segfault when s_openal=0 but USE_OPENAL=1
If the game was compiled with openal support (USE_OPENAL is defined), but it's disabled via cvar (set s_openal 0) there could be segfaults when calls to openal where done anyway, because the check if(sound_started == SS_OAL) was forgotten. This is fixed now.
This commit is contained in:
parent
5bf1ee670d
commit
62d76b3d40
2 changed files with 6 additions and 1 deletions
|
@ -413,6 +413,9 @@ void AL_Update( void ) {
|
|||
void AL_Underwater()
|
||||
{
|
||||
int i;
|
||||
if(sound_started != SS_OAL) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Apply to all sources
|
||||
for (i = 0; i < s_numchannels; i++)
|
||||
|
|
|
@ -588,7 +588,9 @@ OGG_Stop ( void )
|
|||
}
|
||||
|
||||
#ifdef USE_OPENAL
|
||||
AL_UnqueueRawSamples();
|
||||
if(sound_started == SS_OAL) {
|
||||
AL_UnqueueRawSamples();
|
||||
}
|
||||
#endif
|
||||
|
||||
ov_clear( &ovFile );
|
||||
|
|
Loading…
Reference in a new issue