[geos-commits] [SCM] GEOS branch 3.14 updated. 25e08d264b9a1eb2267e76207da7995cf8c8254c
git at osgeo.org
git at osgeo.org
Tue Dec 16 06:48:47 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.14 has been updated
via 25e08d264b9a1eb2267e76207da7995cf8c8254c (commit)
from d7d33e311a0f1383011ed127b54baa1c3befbb68 (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 25e08d264b9a1eb2267e76207da7995cf8c8254c
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Dec 2 08:42:23 2025 -0500
BufferOp: Avoid crash on geometry with only invalid coordinates
diff --git a/NEWS.md b/NEWS.md
index 712f49a09..c77fa6a50 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -5,6 +5,7 @@
- Fixes/Improvements:
- Relax other floating-point exception handling with other compilers (GH-1333, Mike Taves)
- Quiet FP_DIVBYZERO exception from CGAlgorithmsDD::intersection (GH-1235, Paul Ramsey)
+ - Avoid crash on buffer of geometry with only invalid coordinates (GH-1335, Dan Baston)
## Changes in 3.14.1
2025-10-27
diff --git a/src/operation/buffer/BufferCurveSetBuilder.cpp b/src/operation/buffer/BufferCurveSetBuilder.cpp
index 7fc39e77c..bde2aacf4 100644
--- a/src/operation/buffer/BufferCurveSetBuilder.cpp
+++ b/src/operation/buffer/BufferCurveSetBuilder.cpp
@@ -201,6 +201,10 @@ BufferCurveSetBuilder::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 b51914ca8..7c78fa41e 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>
@@ -20,6 +22,7 @@
#include <memory>
#include <string>
+
using namespace geos::operation::buffer;
namespace tut {
@@ -623,4 +626,19 @@ void object::test<28>
"MULTIPOLYGON (((24 95.239, 24 96, 24 99, 24.816 99, 24 95.239)), ((3 90, 3 93, 3 96, 3 99, 21 99, 21 96, 21 93, 21 90, 3 90)))");
}
+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.md | 1 +
src/operation/buffer/BufferCurveSetBuilder.cpp | 4 ++++
tests/unit/operation/buffer/BufferOpTest.cpp | 18 ++++++++++++++++++
3 files changed, 23 insertions(+)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list