[geos-commits] [SCM] GEOS branch main updated. fc0722fcc2cd925e0a4d445a93f630b5ea4c9f07

git at osgeo.org git at osgeo.org
Wed Jun 19 18:08:06 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, main has been updated
       via  fc0722fcc2cd925e0a4d445a93f630b5ea4c9f07 (commit)
      from  87e98b72ebfe3510a2c235ae8b23e64503f6adab (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 fc0722fcc2cd925e0a4d445a93f630b5ea4c9f07
Author: Dan Baston <dbaston at gmail.com>
Date:   Wed Jun 19 21:07:40 2024 -0400

    GEOSConcaveHullOfPolygons: Avoid crash on zero-area input (#1076)
    
    * GEOSConcaveHullOfPolygons: Avoid crash on zero-area input
    
    Resolves https://github.com/libgeos/geos/issues/1071

diff --git a/src/algorithm/hull/ConcaveHullOfPolygons.cpp b/src/algorithm/hull/ConcaveHullOfPolygons.cpp
index d0ab8e426..6ed54fb0a 100644
--- a/src/algorithm/hull/ConcaveHullOfPolygons.cpp
+++ b/src/algorithm/hull/ConcaveHullOfPolygons.cpp
@@ -156,7 +156,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 57c6a0b9c..2cd039fb5 100644
--- a/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp
+++ b/tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp
@@ -62,6 +62,15 @@ void object::test<3>()
     result_ = GEOSConcaveHullOfPolygons(input_, 0.7, false, false);
     ensure("curved geometry not supported", result_ == nullptr);
 }
+  
+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:
 src/algorithm/hull/ConcaveHullOfPolygons.cpp      | 2 +-
 tests/unit/capi/GEOSConcaveHullOfPolygonsTest.cpp | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list