[geos-commits] [SCM] GEOS branch 3.11 updated. 63930d5392860983292b421b258cbbba530191ac
git at osgeo.org
git at osgeo.org
Tue Dec 16 06:56:12 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.11 has been updated
via 63930d5392860983292b421b258cbbba530191ac (commit)
from 6efb5efe2f0f30b0834329aeb3283a81943436c2 (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 63930d5392860983292b421b258cbbba530191ac
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Dec 16 09:55:34 2025 -0500
BufferOp: Avoid crash on geometry with only invalid coordinates
diff --git a/NEWS.md b/NEWS.md
index e545f4296..b0a84ad35 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -3,6 +3,7 @@
- Fixes/Improvements:
- Fix DepthSegment comparison logic (really this time) (GH-1266, Martin Davis)
+ - Avoid crash on buffer of geometry with only invalid coordinates (GH-1335, Dan Baston)
## Changes in 3.11.5
2025-03-03
diff --git a/src/operation/buffer/BufferCurveSetBuilder.cpp b/src/operation/buffer/BufferCurveSetBuilder.cpp
index 787f1b5c6..5f3f3dbc6 100644
--- a/src/operation/buffer/BufferCurveSetBuilder.cpp
+++ b/src/operation/buffer/BufferCurveSetBuilder.cpp
@@ -199,6 +199,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 1103a0b46..ed606ce5b 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>
@@ -21,6 +23,7 @@
#include <string>
#include <vector>
+
using namespace geos::operation::buffer;
using namespace geos::geom;
@@ -673,4 +676,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