fix some accesses beyond the end of arrays spotted via clang

This commit is contained in:
Jonathan Gray 2013-04-21 23:54:56 +10:00
parent c5fceea9f3
commit 583b8948a8
3 changed files with 2 additions and 4 deletions

View file

@ -1048,7 +1048,6 @@ static void R_LoadFogs( lump_t *l, lump_t *brushesLump, lump_t *sidesLump ) {
out->parms.color[0] = 0.0f; out->parms.color[0] = 0.0f;
out->parms.color[1] = 0.0f; out->parms.color[1] = 0.0f;
out->parms.color[2] = 0.0f; out->parms.color[2] = 0.0f;
out->parms.color[3] = 0.0f;
out->parms.depthForOpaque = 0.0f; out->parms.depthForOpaque = 0.0f;
out->colorInt = 0x00000000; out->colorInt = 0x00000000;
out->tcScale = 0.0f; out->tcScale = 0.0f;

View file

@ -344,9 +344,8 @@ void RE_LAGoggles( void )
fog->parms.color[0] = 0.75f; fog->parms.color[0] = 0.75f;
fog->parms.color[1] = 0.42f + random() * 0.025f; fog->parms.color[1] = 0.42f + random() * 0.025f;
fog->parms.color[2] = 0.07f; fog->parms.color[2] = 0.07f;
fog->parms.color[3] = 1.0f;
fog->parms.depthForOpaque = 10000; fog->parms.depthForOpaque = 10000;
fog->colorInt = ColorBytes4(fog->parms.color[0], fog->parms.color[1], fog->parms.color[2], fog->parms.color[3]); fog->colorInt = ColorBytes3(fog->parms.color[0], fog->parms.color[1], fog->parms.color[2]);
fog->tcScale = 2.0f / ( fog->parms.depthForOpaque * (1.0f + cos( tr.refdef.floatTime) * 0.1f)); fog->tcScale = 2.0f / ( fog->parms.depthForOpaque * (1.0f + cos( tr.refdef.floatTime) * 0.1f));
} }

View file

@ -614,7 +614,7 @@ void RB_CalcColorFromOneMinusEntity( unsigned char *dstColors )
{ {
int i; int i;
int *pColors = ( int * ) dstColors; int *pColors = ( int * ) dstColors;
unsigned char invModulate[3]; unsigned char invModulate[4];
int c; int c;
if ( !backEnd.currentEntity ) if ( !backEnd.currentEntity )