diff --git a/engine/client/cl_game.c b/engine/client/cl_game.c index d73cddb8..95f45b15 100644 --- a/engine/client/cl_game.c +++ b/engine/client/cl_game.c @@ -2422,7 +2422,7 @@ static void GAME_EXPORT pfnKillEvents( int entnum, const char *eventname ) if( eventIndex >= MAX_EVENTS ) return; - if( entnum < 0 || entnum > clgame.maxEntities ) + if( entnum < 0 || entnum >= clgame.maxEntities ) return; es = &cl.events; diff --git a/engine/client/mod_dbghulls.c b/engine/client/mod_dbghulls.c index 2832c9c4..65a16310 100644 --- a/engine/client/mod_dbghulls.c +++ b/engine/client/mod_dbghulls.c @@ -684,7 +684,7 @@ static void Mod_CreatePolygonsForHull( int hullnum ) char name[8]; int i; - if( hullnum < 0 || hullnum > 3 ) + if( hullnum < 0 || hullnum >= MAX_MAP_HULLS ) return; if( !world.num_hull_models ) diff --git a/engine/client/vid_common.c b/engine/client/vid_common.c index 23007c70..1dbb11ae 100644 --- a/engine/client/vid_common.c +++ b/engine/client/vid_common.c @@ -93,7 +93,7 @@ VID_GetModeString const char *VID_GetModeString( int vid_mode ) { vidmode_t *vidmode; - if( vid_mode < 0 || vid_mode > R_MaxVideoModes() ) + if( vid_mode < 0 || vid_mode >= R_MaxVideoModes() ) return NULL; if( !( vidmode = R_GetVideoMode( vid_mode ) ) ) diff --git a/engine/common/mod_bmodel.c b/engine/common/mod_bmodel.c index f23bb6ba..e7cb6590 100644 --- a/engine/common/mod_bmodel.c +++ b/engine/common/mod_bmodel.c @@ -2791,7 +2791,7 @@ static void Mod_LoadTexInfo( model_t *mod, dbspmodel_t *bmod ) out->vecs[j][k] = in->vecs[j][k]; miptex = in->miptex; - if( miptex < 0 || miptex > mod->numtextures ) + if( miptex < 0 || miptex >= mod->numtextures ) miptex = 0; // this is possible? out->texture = mod->textures[miptex]; out->flags = in->flags;