engine: client: fix buffer overflow in voice sound mixer
This commit is contained in:
parent
a5ef33b302
commit
5554d13f7f
1 changed files with 6 additions and 2 deletions
|
@ -923,7 +923,7 @@ static void S_MixUpsample( int sampleCount, int filtertype )
|
||||||
static void MIX_MixRawSamplesBuffer( int end )
|
static void MIX_MixRawSamplesBuffer( int end )
|
||||||
{
|
{
|
||||||
portable_samplepair_t *pbuf, *roombuf, *streambuf;
|
portable_samplepair_t *pbuf, *roombuf, *streambuf;
|
||||||
uint i, j, stop;
|
uint i, j, stop;
|
||||||
|
|
||||||
roombuf = MIX_GetPFrontFromIPaint( IROOMBUFFER );
|
roombuf = MIX_GetPFrontFromIPaint( IROOMBUFFER );
|
||||||
streambuf = MIX_GetPFrontFromIPaint( ISTREAMBUFFER );
|
streambuf = MIX_GetPFrontFromIPaint( ISTREAMBUFFER );
|
||||||
|
@ -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 ));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue