Browse Source

engine: client: fix array overruns

pull/2/head
Alibek Omarov 3 years ago
parent
commit
ac40badaa5
  1. 4
      engine/client/cl_events.c
  2. 2
      engine/client/cl_frame.c

4
engine/client/cl_events.c

@ -158,7 +158,7 @@ CL_EventIndex
*/ */
word CL_EventIndex( const char *name ) word CL_EventIndex( const char *name )
{ {
int i; word i;
if( !COM_CheckString( name )) if( !COM_CheckString( name ))
return 0; return 0;
@ -484,7 +484,7 @@ void GAME_EXPORT CL_PlaybackEvent( int flags, const edict_t *pInvoker, word even
return; return;
// first check event for out of bounds // first check event for out of bounds
if( eventindex < 1 || eventindex > MAX_EVENTS ) if( eventindex < 1 || eventindex >= MAX_EVENTS )
{ {
Con_DPrintf( S_ERROR "CL_PlaybackEvent: invalid eventindex %i\n", eventindex ); Con_DPrintf( S_ERROR "CL_PlaybackEvent: invalid eventindex %i\n", eventindex );
return; return;

2
engine/client/cl_frame.c

@ -222,7 +222,7 @@ void CL_UpdateLatchedVars( cl_entity_t *ent )
if( ent->curstate.sequence != ent->prevstate.sequence ) if( ent->curstate.sequence != ent->prevstate.sequence )
{ {
memcpy( ent->latched.prevseqblending, ent->prevstate.blending, sizeof( ent->prevstate.blending )); memcpy( ent->latched.prevseqblending, ent->prevstate.blending, sizeof( ent->latched.prevseqblending ));
ent->latched.prevsequence = ent->prevstate.sequence; ent->latched.prevsequence = ent->prevstate.sequence;
ent->latched.sequencetime = ent->curstate.animtime; ent->latched.sequencetime = ent->curstate.animtime;
} }

Loading…
Cancel
Save