engine: fix some possible off by one errors
This commit is contained in:
parent
8f7f311f60
commit
229f1560b0
4 changed files with 4 additions and 4 deletions
|
@ -2422,7 +2422,7 @@ static void GAME_EXPORT pfnKillEvents( int entnum, const char *eventname )
|
||||||
if( eventIndex >= MAX_EVENTS )
|
if( eventIndex >= MAX_EVENTS )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( entnum < 0 || entnum > clgame.maxEntities )
|
if( entnum < 0 || entnum >= clgame.maxEntities )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
es = &cl.events;
|
es = &cl.events;
|
||||||
|
|
|
@ -684,7 +684,7 @@ static void Mod_CreatePolygonsForHull( int hullnum )
|
||||||
char name[8];
|
char name[8];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if( hullnum < 0 || hullnum > 3 )
|
if( hullnum < 0 || hullnum >= MAX_MAP_HULLS )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if( !world.num_hull_models )
|
if( !world.num_hull_models )
|
||||||
|
|
|
@ -93,7 +93,7 @@ VID_GetModeString
|
||||||
const char *VID_GetModeString( int vid_mode )
|
const char *VID_GetModeString( int vid_mode )
|
||||||
{
|
{
|
||||||
vidmode_t *vidmode;
|
vidmode_t *vidmode;
|
||||||
if( vid_mode < 0 || vid_mode > R_MaxVideoModes() )
|
if( vid_mode < 0 || vid_mode >= R_MaxVideoModes() )
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if( !( vidmode = R_GetVideoMode( vid_mode ) ) )
|
if( !( vidmode = R_GetVideoMode( vid_mode ) ) )
|
||||||
|
|
|
@ -2791,7 +2791,7 @@ static void Mod_LoadTexInfo( model_t *mod, dbspmodel_t *bmod )
|
||||||
out->vecs[j][k] = in->vecs[j][k];
|
out->vecs[j][k] = in->vecs[j][k];
|
||||||
|
|
||||||
miptex = in->miptex;
|
miptex = in->miptex;
|
||||||
if( miptex < 0 || miptex > mod->numtextures )
|
if( miptex < 0 || miptex >= mod->numtextures )
|
||||||
miptex = 0; // this is possible?
|
miptex = 0; // this is possible?
|
||||||
out->texture = mod->textures[miptex];
|
out->texture = mod->textures[miptex];
|
||||||
out->flags = in->flags;
|
out->flags = in->flags;
|
||||||
|
|
Loading…
Add table
Reference in a new issue