engine: client: fix buffer overflow in voice sound mixer

This commit is contained in:
Alibek Omarov 2024-07-28 16:41:20 +03:00
parent a5ef33b302
commit 5554d13f7f

View file

@ -956,7 +956,11 @@ static void MIX_MixRawSamplesBuffer( int end )
} }
if( ch->entnum > 0 ) if( ch->entnum > 0 )
SND_MoveMouthRaw( ch, &ch->rawsamples[paintedtime & ( ch->max_samples - 1 )], stop - paintedtime ); {
int pos = paintedtime & ( ch->max_samples - 1 );
SND_MoveMouthRaw( ch, &ch->rawsamples[pos], bound( 0, ch->max_samples - pos, stop - paintedtime ));
}
} }
} }