Skip to content

Commit 89d67c8

Browse files
committed
A few warnings from Travis. Including an out of bound access
1 parent 8dbdaa7 commit 89d67c8

2 files changed

Lines changed: 14 additions & 12 deletions

File tree

code/botlib/be_aas_reach.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2141,6 +2141,8 @@ int AAS_Reachability_Jump(int area1num, int area2num)
21412141
if (area2->mins[2] > area1->maxs[2] + maxjumpheight) return qfalse;
21422142
//
21432143
bestdist = 999999;
2144+
memset(&beststart2, 0, sizeof(beststart2));
2145+
memset(&bestend2,0,sizeof(bestend2));
21442146
//
21452147
for (i = 0; i < area1->numfaces; i++)
21462148
{
@@ -3163,6 +3165,8 @@ aas_lreachability_t *AAS_FindFaceReachabilities(vec3_t *facepoints, int numpoint
31633165
lreachabilities = NULL;
31643166
bestfacenum = 0;
31653167
bestfaceplane = NULL;
3168+
memset(&beststart2, 0, sizeof(beststart2));
3169+
memset(&bestend2, 0 , sizeof(bestend2));
31663170
//
31673171
for (i = 1; i < aasworld.numareas; i++)
31683172
{

code/renderer_oa/tr_shade_calc.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,17 +1401,16 @@ void RB_CalcAtlasTexCoords( const atlas_t *at, float *st )
14011401
int frametotal = w * h;
14021402
float alha = ((0.25+backEnd.currentEntity->e.shaderRGBA[3]) / (tr.identityLight * 256.0f));
14031403
int framethere = frametotal - ((frametotal * alha));
1404-
int f;
1405-
framex = 0;
1406-
for(f=0; f<framethere; f++)
1407-
{
1408-
framex +=1;
1409-
1410-
if (framex >= w){
1411-
framey +=1; // next row!
1412-
framex = 0; // reset column
1413-
}
1404+
framex = 0;
1405+
for(int f=0; f<framethere; f++)
1406+
{
1407+
framex +=1;
1408+
1409+
if (framex >= w){
1410+
framey +=1; // next row!
1411+
framex = 0; // reset column
14141412
}
1413+
}
14151414

14161415
}
14171416
else // static/animated
@@ -1452,12 +1451,11 @@ void RB_CalcAtlasTexCoords( const atlas_t *at, float *st )
14521451

14531452
tmi.matrix[0][0] = 1.0f / w;
14541453
tmi.matrix[1][0] = 0;
1455-
tmi.matrix[2][0] = 0;
1454+
tmi.matrix[0][1] = 0;
14561455
tmi.translate[0] = ((1.0f / w) * framex);
14571456

14581457
tmi.matrix[0][1] = 0;
14591458
tmi.matrix[1][1] = 1.0f / h;
1460-
tmi.matrix[2][1] = 0;
14611459
tmi.translate[1] = ((1.0f / h) * framey);
14621460

14631461
RB_CalcTransformTexCoords( &tmi, st );

0 commit comments

Comments
 (0)