fixed a crash due to lack of memory for the sound system

This commit is contained in:
myT 2019-09-25 05:59:17 +02:00
parent f674e9faf1
commit c024cdcdc9
2 changed files with 5 additions and 0 deletions

View file

@ -107,6 +107,8 @@ chg: r_fullbright is now latched again
chg: negative r_swapInterval values will request adaptive v-sync when using an OpenGL back-end
fix: crash due to lack of memory for the sound system
fix: incorrect shader state when loading a map with no lighting
fix: fog-only non-sky shaders were incorrectly handled as sky shaders, which broke fog on many maps

View file

@ -260,6 +260,9 @@ void S_PaintChannels( int endtime ) {
ltime = s_paintedtime;
sfx = ch->thesfx;
if (sfx->soundData==NULL || sfx->soundLength==0) {
continue;
}
sampleOffset = ltime - ch->startSample;
count = end - ltime;
if ( sampleOffset + count > sfx->soundLength ) {