Skip to content

Commit

Permalink
Per #2644, additional range checking to handle bad input values of t.
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnHalleyGotway committed Aug 14, 2023
1 parent 7915662 commit b7f4929
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/basic/vx_math/ptile.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if ( n > 0 ) {
p = ordered_array[index];
}
// Interpolate linearly between two values
else {
else if ( index >= 0 && index < (n - 1) ) {
delta = (n - 1)*t - index;
p = (1 - delta)*ordered_array[index] + delta*ordered_array[index + 1];
}
Expand Down

0 comments on commit b7f4929

Please sign in to comment.