[geos-commits] [SCM] GEOS branch 3.10 updated. be92f62f870cef058c1d2c6446347456f5f774ec

git at osgeo.org git at osgeo.org
Tue Dec 16 07:00:42 PST 2025


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.10 has been updated
       via  be92f62f870cef058c1d2c6446347456f5f774ec (commit)
      from  1621a9dbb2d473d6ba0ff9132e937a9e753f41db (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 be92f62f870cef058c1d2c6446347456f5f774ec
Author: Daniel Baston <dbaston at gmail.com>
Date:   Tue Dec 16 10:00:18 2025 -0500

    BufferOp: Avoid crash on geometry with only invalid coordinates

diff --git a/NEWS b/NEWS
index 706ccec38..adcbd87a1 100644
--- a/NEWS
+++ b/NEWS
@@ -2,7 +2,7 @@
 2025-xx-xx
 
 - Fixes/Improvements:
-  -
+  - Avoid crash on buffer of geometry with only invalid coordinates (GH-1335, Dan Baston)
 
 ## Changes in 3.10.7
 2025-03-03
diff --git a/src/operation/buffer/OffsetCurveSetBuilder.cpp b/src/operation/buffer/OffsetCurveSetBuilder.cpp
index e4db66496..e6166438b 100644
--- a/src/operation/buffer/OffsetCurveSetBuilder.cpp
+++ b/src/operation/buffer/OffsetCurveSetBuilder.cpp
@@ -209,6 +209,10 @@ OffsetCurveSetBuilder::addLineString(const LineString* line)
 
     auto coord = operation::valid::RepeatedPointRemover::removeRepeatedAndInvalidPoints(line->getCoordinatesRO());
 
+    if (coord->isEmpty()) {
+        throw util::GEOSException("LineString has no valid points.");
+    }
+
     /**
      * Rings (closed lines) are generated with a continuous curve,
      * with no end arcs. This produces better quality linework,
diff --git a/tests/unit/operation/buffer/BufferOpTest.cpp b/tests/unit/operation/buffer/BufferOpTest.cpp
index b010da9e9..49f1c1ebd 100644
--- a/tests/unit/operation/buffer/BufferOpTest.cpp
+++ b/tests/unit/operation/buffer/BufferOpTest.cpp
@@ -3,6 +3,8 @@
 
 // tut
 #include <tut/tut.hpp>
+#include <tut/tut_macros.hpp>
+
 #include <utility.h>
 // geos
 #include <geos/operation/buffer/BufferOp.h>
@@ -19,7 +21,8 @@
 // std
 #include <memory>
 #include <string>
-#include <vector>
+
+using namespace geos::operation::buffer;
 
 namespace tut {
 //
@@ -549,4 +552,19 @@ void object::test<20>
     ensure( 0 == dynamic_cast<const geos::geom::Polygon*>(result1.get())->getNumInteriorRing() );
 }
 
+template<>
+template<>
+void object::test<31>
+()
+{
+    set_test_name("buffer of line with only Inf coordinates");
+    // See https://github.com/libgeos/geos/issues/1332
+
+    std::string wkt = "LINESTRING (Inf Inf, Inf Inf)";
+
+    auto geom = wktreader.read(wkt);
+
+    ensure_THROW(geom->buffer(0.1), geos::util::GEOSException);
+}
+
 } // namespace tut

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                           |  2 +-
 src/operation/buffer/OffsetCurveSetBuilder.cpp |  4 ++++
 tests/unit/operation/buffer/BufferOpTest.cpp   | 20 +++++++++++++++++++-
 3 files changed, 24 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list