Skip to content

Commit

Permalink
bugfix:angle_compensate_nodes will be out of range if angle >= 359.25
Browse files Browse the repository at this point in the history
  • Loading branch information
WubinXia committed Oct 8, 2019
1 parent 95d935f commit 4b6ea54
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,11 @@ int main(int argc, char * argv[]) {
int angle_value = (int)(angle * angle_compensate_multiple);
if ((angle_value - angle_compensate_offset) < 0) angle_compensate_offset = angle_value;
for (j = 0; j < angle_compensate_multiple; j++) {
angle_compensate_nodes[angle_value-angle_compensate_offset+j] = nodes[i];

int angle_compensate_nodes_index = angle_value-angle_compensate_offset+j;
if(angle_compensate_nodes_index >= angle_compensate_nodes_count)
angle_compensate_nodes_index = angle_compensate_nodes_count-1;
angle_compensate_nodes[angle_compensate_nodes_index] = nodes[i];
}
}
}
Expand Down

0 comments on commit 4b6ea54

Please sign in to comment.