[geos-commits] [SCM] GEOS branch 3.10 updated. 94853b664293e808dbcf6964e5943a36a261ef29

git at osgeo.org git at osgeo.org
Fri Oct 29 14:45:45 PDT 2021


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  94853b664293e808dbcf6964e5943a36a261ef29 (commit)
       via  20aec05fd1973b029e27ec06259ab8b63f351db2 (commit)
       via  14f0a696b8d7a1c26a32d3fd79e5da5e4b66c219 (commit)
      from  793f3cbf3d701d124f94bf2d0eaa98df43199973 (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 94853b664293e808dbcf6964e5943a36a261ef29
Merge: 20aec05fd 793f3cbf3
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Oct 29 14:45:41 2021 -0700

    Merge branch '3.10' of https://git.osgeo.org/gitea/geos/geos into 3.10


commit 20aec05fd1973b029e27ec06259ab8b63f351db2
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Oct 29 14:45:32 2021 -0700

    NEWS item for 1135 fix

diff --git a/NEWS b/NEWS
index 8acfd4889..03ac7e6c1 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ Changes in 3.10.1
 
 - Fixes/Improvements:
   - Fix mistake in constants used to select WKB flavor in C API (GH489, Paul Ramsey)
+  - Fix crash when reducing precision on a LinearRing (#1135, Paul Ramsey)
 
 
 Changes in 3.10.0

commit 14f0a696b8d7a1c26a32d3fd79e5da5e4b66c219
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Fri Oct 29 14:33:35 2021 -0700

    Check for empty Sequence when collapsing linear ring. References #1135

diff --git a/src/geom/util/GeometryTransformer.cpp b/src/geom/util/GeometryTransformer.cpp
index faa7f8f3f..19c4bd5f0 100644
--- a/src/geom/util/GeometryTransformer.cpp
+++ b/src/geom/util/GeometryTransformer.cpp
@@ -202,7 +202,7 @@ GeometryTransformer::transformLinearRing(
     CoordinateSequence::Ptr seq(transformCoordinates(
                                     geom->getCoordinatesRO(), geom));
 
-    auto seqSize = seq->size();
+    std::size_t seqSize = seq ? seq->size() : 0;
 
     // ensure a valid LinearRing
     if(seqSize > 0 && seqSize < 4 && ! preserveType) {
diff --git a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
index 06f4148fa..4864d02a0 100644
--- a/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
+++ b/tests/unit/capi/GEOSGeom_setPrecisionTest.cpp
@@ -158,5 +158,16 @@ void object::test<9> ()
     ensure_geometry_equals(geom2_, "LINESTRING (0 0, 0 0)");
 }
 
+
+// Collapse a linearRing / Trac #1135
+template<>
+template<>
+void object::test<10> ()
+{
+    geom1_ = fromWKT("LINEARRING (0 0, 0.1 0, 0.1 0.1, 0 0.1, 0 0)");
+    geom2_ = GEOSGeom_setPrecision(geom1_, 1.0, 0);
+    ensure_geometry_equals(geom2_, "LINEARRING EMPTY");
+}
+
 } // namespace tut
 

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

Summary of changes:
 NEWS                                          |  1 +
 src/geom/util/GeometryTransformer.cpp         |  2 +-
 tests/unit/capi/GEOSGeom_setPrecisionTest.cpp | 11 +++++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list