BUGFIX: Avoid segfault when calling find_optimal_alpha with less that 3 points

This commit is contained in:
Sébastien Loriot 2011-06-09 10:04:51 +00:00
parent bed9ead9ba
commit 1c2852d004
1 changed files with 2 additions and 0 deletions

View File

@ -1406,6 +1406,8 @@ Alpha_shape_2<Dt>::find_alpha_solid() const
// starting point for searching
// takes O(#alpha_shape) time
Coord_type alpha_solid = 0;
if (number_of_vertices()<3) return alpha_solid;
Finite_vertices_iterator vertex_it;
// only finite vertices