[SCM] PostGIS branch stable-3.4 updated. 3.4.1-3-g4db644f7f
git at osgeo.org
git at osgeo.org
Wed Nov 22 13:12:18 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.4 has been updated
via 4db644f7fc7e3c1def2226c2be168af14feebf3d (commit)
from 1adcf5564b1df50658b8692a6e9221caf3fcd2ce (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 4db644f7fc7e3c1def2226c2be168af14feebf3d
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 7c890c6b0..0237f5b77 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,11 @@ This version requires PostgreSQL 12-16, GEOS 3.6 or higher, and Proj 6.1+.
To take advantage of all features, GEOS 3.12+ is needed.
To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
+* Bug Fixes *
+
+ - #5571, Memory over-allocation for narrow inputs (Paul Ramsey)
+
+
* Bug Fixes and Enhancments *
PostGIS 3.4.1
diff --git a/liblwgeom/lwgeom_geos.c b/liblwgeom/lwgeom_geos.c
index 56b38b0be..bbaefa02e 100644
--- a/liblwgeom/lwgeom_geos.c
+++ b/liblwgeom/lwgeom_geos.c
@@ -1748,8 +1748,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 | 5 +++++
liblwgeom/lwgeom_geos.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list