Add a sanity check against buffer overflows to S_BuildSoundList

This commit is contained in:
Yamagi Burmeister 2012-05-12 14:46:13 +02:00
parent 4a414b588e
commit aff51633d0

View file

@ -965,6 +965,10 @@ void S_BuildSoundList( int *sounds ) {
for ( i = 0; i < cl.frame.num_entities; i++ )
{
if (i >= MAX_EDICTS) {
break;
}
num = ( cl.frame.parse_entities + i ) & ( MAX_PARSE_ENTITIES - 1 );
ent = &cl_parse_entities [ num ];
if( s_ambient->value == 2 && !ent->modelindex ) {