Fix associativity bug in get_zcorn_sign
The bug can also cause c2 to be larger than the length of actnum, leading to segmentation faults.
This commit is contained in:
@@ -588,7 +588,7 @@ get_zcorn_sign(int nx, int ny, int nz, const int *actnum,
|
||||
z2 = sign*zcorn[i+2*nx*(j+2*ny*(k+1))];
|
||||
|
||||
c1 = i/2 + nx*(j/2 + ny*k/2);
|
||||
c2 = i/2 + nx*(j/2 + ny*(k+1)/2);
|
||||
c2 = i/2 + nx*(j/2 + ny*((k+1)/2));
|
||||
|
||||
if (((actnum == NULL) ||
|
||||
(actnum[c1] && actnum[c2]))
|
||||
|
||||
Reference in New Issue
Block a user