Fix limit check before accessing array in opennl
Please note that opennl is already modified (for double precision) so re-integration is not really easy. Also, we'll eventually switch to Eigen. For until that let's just solve the condition in our bundled opennl.
This commit is contained in:
parent
a86482f81c
commit
f23338e107
Notes:
blender-bot
2023-02-14 09:38:57 +01:00
Referenced by issue #43165, [PATCH] Fix array index 'j' is used before limits check.
|
@ -99,7 +99,7 @@ heap_relax_snode (
|
|||
}
|
||||
j++;
|
||||
/* Search for a new leaf */
|
||||
while ( descendants[j] != 0 && j < n ) j++;
|
||||
while ( j < n && descendants[j] != 0 ) j++;
|
||||
}
|
||||
|
||||
#if ( PRNTlevel>=1 )
|
||||
|
|
|
@ -66,7 +66,7 @@ relax_snode (
|
|||
relax_end[snode_start] = j; /* Last column is recorded */
|
||||
j++;
|
||||
/* Search for a new leaf */
|
||||
while ( descendants[j] != 0 && j < n ) j++;
|
||||
while ( j < n && descendants[j] != 0 ) j++;
|
||||
}
|
||||
|
||||
/*printf("No of relaxed snodes: %d; relaxed columns: %d\n",
|
||||
|
|
Loading…
Reference in New Issue