Fix memory access beyond vector bounds. Reported by valgrind
This commit is contained in:
parent
a74edcd91b
commit
a61df8aec0
1 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ double tgContour::GetMinimumAngle( void ) const
|
||||||
|
|
||||||
p2_index = i;
|
p2_index = i;
|
||||||
|
|
||||||
if ( i == size ) {
|
if ( i == size - 1 ) {
|
||||||
p3_index = 0;
|
p3_index = 0;
|
||||||
} else {
|
} else {
|
||||||
p3_index = i + 1;
|
p3_index = i + 1;
|
||||||
|
@ -852,4 +852,4 @@ std::ostream& operator<< ( std::ostream& output, const tgContour& subject )
|
||||||
output << "Hole: " << subject.hole << "\n";
|
output << "Hole: " << subject.hole << "\n";
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue