[geos-commits] [SCM] GEOS branch 3.11 updated. b72a68df852a704d63f08263455da12dc5c9b822
git at osgeo.org
git at osgeo.org
Thu Oct 24 13:12:46 PDT 2024
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".
The branch, 3.11 has been updated
via b72a68df852a704d63f08263455da12dc5c9b822 (commit)
from 9e4fb70897a2abcd70a1c8831d2ddedd65f7c5d8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit b72a68df852a704d63f08263455da12dc5c9b822
Author: Daniel Baston <dbaston at gmail.com>
Date: Wed Jun 19 21:07:40 2024 -0400
GEOSConcaveHullOfPolygons: Avoid crash on zero-area input, references GH-1071
diff --git a/NEWS.md b/NEWS.md
index f9b07564b..466f06001 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -7,6 +7,7 @@
- GEOSRelatePatternMatch: Fix crash on invalid DE-9IM pattern (GH-1089, Dan Baston)
- Port TopologyPreservingSimplifier fixes (GH-986, GH-1107, GH-857, GH-784, GH-1070, Paul Ramsey)
- Fix ConcaveHullOfPolygons nested shell handling (GH-1169, Martin Davis)
+ - GEOSConcaveHullOfPolygons, Avoid crash on zero-area input (GH-1071, Dan Baston)
## Changes in 3.11.4
2024-06-05
diff --git a/src/algorithm/hull/ConcaveHullOfPolygons.cpp b/src/algorithm/hull/ConcaveHullOfPolygons.cpp
index 623a7662a..d49b5eff1 100644
--- a/src/algorithm/hull/ConcaveHullOfPolygons.cpp
+++ b/src/algorithm/hull/ConcaveHullOfPolygons.cpp
@@ -154,7 +154,7 @@ ConcaveHullOfPolygons::setTight(bool p_isTight)
std::unique_ptr<Geometry>
ConcaveHullOfPolygons::getHull()
{
- if (inputPolygons->isEmpty()) {
+ if (inputPolygons->isEmpty() || inputPolygons->getArea() == 0) {
return createEmptyHull();
}
buildHullTris();
diff --git a/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp b/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp
index a5a485e9d..16a80299a 100644
--- a/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp
+++ b/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp
@@ -54,6 +54,15 @@ void object::test<2>()
ensure_geometry_equals(geom1_, expected_);
}
+template<>
+template<>
+void object::test<4>()
+{
+ input_ = fromWKT("POLYGON((0 0, 0 0, 0 0))");
+ result_ = GEOSConcaveHullOfPolygons(input_, 0.7, false, false);
+ ensure(GEOSisEmpty(result_));
+}
+
} // namespace tut
-----------------------------------------------------------------------
Summary of changes:
NEWS.md | 1 +
src/algorithm/hull/ConcaveHullOfPolygons.cpp | 2 +-
tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp | 9 +++++++++
3 files changed, 11 insertions(+), 1 deletion(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list