A few warnings from Travis. Including an out of bound access

This commit is contained in:
sago007
2018-02-10 17:34:54 +01:00
parent 8dbdaa7704
commit 89d67c8c3e
2 changed files with 13 additions and 11 deletions

View File

@@ -2141,6 +2141,8 @@ int AAS_Reachability_Jump(int area1num, int area2num)
if (area2->mins[2] > area1->maxs[2] + maxjumpheight) return qfalse;
//
bestdist = 999999;
memset(&beststart2, 0, sizeof(beststart2));
memset(&bestend2,0,sizeof(bestend2));
//
for (i = 0; i < area1->numfaces; i++)
{
@@ -3163,6 +3165,8 @@ aas_lreachability_t *AAS_FindFaceReachabilities(vec3_t *facepoints, int numpoint
lreachabilities = NULL;
bestfacenum = 0;
bestfaceplane = NULL;
memset(&beststart2, 0, sizeof(beststart2));
memset(&bestend2, 0 , sizeof(bestend2));
//
for (i = 1; i < aasworld.numareas; i++)
{

View File

@@ -1401,17 +1401,16 @@ void RB_CalcAtlasTexCoords( const atlas_t *at, float *st )
int frametotal = w * h;
float alha = ((0.25+backEnd.currentEntity->e.shaderRGBA[3]) / (tr.identityLight * 256.0f));
int framethere = frametotal - ((frametotal * alha));
int f;
framex = 0;
for(f=0; f<framethere; f++)
{
framex +=1;
framex = 0;
for(int f=0; f<framethere; f++)
{
framex +=1;
if (framex >= w){
framey +=1; // next row!
framex = 0; // reset column
}
if (framex >= w){
framey +=1; // next row!
framex = 0; // reset column
}
}
}
else // static/animated
@@ -1452,12 +1451,11 @@ void RB_CalcAtlasTexCoords( const atlas_t *at, float *st )
tmi.matrix[0][0] = 1.0f / w;
tmi.matrix[1][0] = 0;
tmi.matrix[2][0] = 0;
tmi.matrix[0][1] = 0;
tmi.translate[0] = ((1.0f / w) * framex);
tmi.matrix[0][1] = 0;
tmi.matrix[1][1] = 1.0f / h;
tmi.matrix[2][1] = 0;
tmi.translate[1] = ((1.0f / h) * framey);
RB_CalcTransformTexCoords( &tmi, st );