[SCM] PostGIS branch stable-3.3 updated. 3.3.5-3-g2c9db6063

git at osgeo.org git at osgeo.org
Wed Nov 22 13:11:40 PST 2023


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 "PostGIS".

The branch, stable-3.3 has been updated
       via  2c9db60637bb31b5dead723baa356dc6ddf6ab40 (commit)
      from  ad37dbdfbef902b7d172a4e1025d17cf80cd770b (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 2c9db60637bb31b5dead723baa356dc6ddf6ab40
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date:   Wed Nov 22 12:40:21 2023 -0800

    Fix ST_GeneratePoints invalid memory alloc request, references #5571

diff --git a/NEWS b/NEWS
index d0d85c978..69085b9da 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ Proj 6.1+, and PostgreSQL 15+.
 
 * Bug Fixes and Enhancements *
 
+ - #5571, Memory over-allocation for narrow inputs (Paul Ramsey)
+
+
 PostGIS 3.3.5
 2023/11/19
 This version requires PostgreSQL 11-16, GEOS 3.6 or higher, and Proj 4.9+
diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c
index afdad095a..7192ee503 100644
--- a/liblwgeom/lwgeom_geos.c
+++ b/liblwgeom/lwgeom_geos.c
@@ -1714,8 +1714,9 @@ lwpoly_to_points(const LWPOLY* lwpoly, uint32_t npoints, int32_t seed)
 		return NULL;
 	}
 
-	/* Gross up our test set a bit to increase odds of getting coverage in one pass */
-	sample_npoints = npoints * bbox_area / area;
+	/* Gross up our test set a bit (but not too much) to increase
+	 * odds of getting coverage in one pass */
+	sample_npoints = npoints * FP_MIN(bbox_area / area, 10000.0);
 
 	/* We're going to generate points using a sample grid as described
 	 * http://lin-ear-th-inking.blogspot.ca/2010/05/more-random-points-in-jts.html to try and get a more uniform

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

Summary of changes:
 NEWS                    | 3 +++
 liblwgeom/lwgeom_geos.c | 5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list