From e7e30f489171a8f3a019f8ca35d691938e546e7b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 8 Mar 2024 01:19:22 +0000 Subject: Bail out early if the input does not define an area --- game/geoData.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'game') diff --git a/game/geoData.cpp b/game/geoData.cpp index 8c635a0..9a08a89 100644 --- a/game/geoData.cpp +++ b/game/geoData.cpp @@ -381,6 +381,10 @@ GeoData::triangleContainsTriangle(const Triangle<2> & a, const Triangle<2> & b) void GeoData::setHeights(const std::span triangleStrip) { + if (triangleStrip.size() < 3) { + return; + } + // Create new vertices std::vector newVerts; newVerts.reserve(newVerts.size()); -- cgit v1.2.3