Do index testing before actually accessing the array pointers with it in function tryfit() in newdc/rend/gles/gles.cpp.

Technically only the i<128 checks matter, but moved them all 'forward' in the if statements for consistency.
This commit is contained in:
Lioncash 2013-12-23 08:54:08 -05:00
parent 312835958d
commit 92a237a828
1 changed files with 4 additions and 4 deletions

View File

@ -749,17 +749,17 @@ void tryfit(float* x,float* y)
int rep=1;
//discard values cliped to 0 or 1
if (y[i]==1 && i<128 && y[i+1]==1)
if (i<128 && y[i]==1 && y[i+1]==1)
continue;
if (y[i]==0 && i>0 && y[i-1]==0)
if (i>0 && y[i]==0 && y[i-1]==0)
continue;
//Add many samples for first and last value (fog-in, fog-out -> important)
if (y[i]!=1 && i>0 && y[i-1]==1)
if (i>0 && y[i]!=1 && y[i-1]==1)
rep=10000;
if (y[i]!=0 && i<128 && y[i+1]==0)
if (i<128 && y[i]!=0 && y[i+1]==0)
rep=10000;
for (int j=0;j<rep;j++)