[geos-commits] [SCM] GEOS branch 3.13 updated. 2bf492cf2c9915663f08f3fc7e7e7b3aef45f6d6
git at osgeo.org
git at osgeo.org
Tue Dec 16 06:50:56 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.13 has been updated
via 2bf492cf2c9915663f08f3fc7e7e7b3aef45f6d6 (commit)
from b41f45a16b5a0d6faee72a5eed3e739cbc727eba (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 2bf492cf2c9915663f08f3fc7e7e7b3aef45f6d6
Author: Daniel Baston <dbaston at gmail.com>
Date: Tue Dec 16 09:50:30 2025 -0500
BufferOp: Avoid crash on geometry with only invalid coordinates
diff --git a/NEWS.md b/NEWS.md
index d413c6c81..cfb667dee 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -1,4 +1,3 @@
-
## Changes in 3.13.2
2025-xx-xx
@@ -9,6 +8,7 @@
- Change CoverageGapFinder to return polygons (Martin Davis)
- Fix incorrect envelope calculation for arcs (GH-1314, Dan Baston)
- 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.13.1
2025-03-03
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 39f8592bb..298eaf7c6 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;
namespace tut {
@@ -624,4 +627,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 | 2 +-
src/operation/buffer/BufferCurveSetBuilder.cpp | 4 ++++
tests/unit/operation/buffer/BufferOpTest.cpp | 18 ++++++++++++++++++
3 files changed, 23 insertions(+), 1 deletion(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list