From 1c2852d004d895be42e0b028a5a643d66fc7d272 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 9 Jun 2011 10:04:51 +0000 Subject: [PATCH] BUGFIX: Avoid segfault when calling find_optimal_alpha with less that 3 points --- Alpha_shapes_2/include/CGAL/Alpha_shape_2.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h index c7b3bf80f02..3f591c79e32 100644 --- a/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h +++ b/Alpha_shapes_2/include/CGAL/Alpha_shape_2.h @@ -1406,6 +1406,8 @@ Alpha_shape_2
::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