mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-04-11 20:51:37 +00:00
Add a sanity check against buffer overflows to S_BuildSoundList
This commit is contained in:
parent
4a414b588e
commit
aff51633d0
1 changed files with 4 additions and 0 deletions
|
@ -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 ) {
|
||||
|
|
Loading…
Reference in a new issue