From 1dbac98d676e6652cfbe5182e3c7b1f34b95eda6 Mon Sep 17 00:00:00 2001 From: wo80 Date: Sun, 13 Feb 2022 14:26:23 +0100 Subject: [PATCH] Work around possible IndexOutOfRangeException in NewLocation code. --- src/Triangle/NewLocation.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Triangle/NewLocation.cs b/src/Triangle/NewLocation.cs index c281c36..12c4f8c 100644 --- a/src/Triangle/NewLocation.cs +++ b/src/Triangle/NewLocation.cs @@ -2290,6 +2290,12 @@ namespace TriangleNet // now the second point is the neighbor's third vertex second_x = returnPoint[0]; second_y = returnPoint[1]; + + if (numvertices == points.Length) + { + Array.Resize(ref points, numvertices * 2); + } + // add a new point to the list of surrounding points points[numvertices] = returnPoint[0]; numvertices++;