[postgis-tickets] r17668 - ST_Subdivide crash on intermediate EMPTY fix.

Darafei komzpa at gmail.com
Sun Aug 4 12:19:23 PDT 2019


Author: komzpa
Date: 2019-08-04 00:19:22 -0700 (Sun, 04 Aug 2019)
New Revision: 17668

Modified:
   branches/2.5/NEWS
   branches/2.5/liblwgeom/lwgeom.c
Log:
ST_Subdivide crash on intermediate EMPTY fix.

Closes #4459


Modified: branches/2.5/NEWS
===================================================================
--- branches/2.5/NEWS	2019-08-04 07:08:37 UTC (rev 17667)
+++ branches/2.5/NEWS	2019-08-04 07:19:22 UTC (rev 17668)
@@ -17,8 +17,10 @@
   - #4419, Use protobuf version to enable/disable mvt/geobuf (Paul Ramsey)
   - #4437, Handle POINT EMPTY in shape loader/dumper (Paul Ramsey)
   - #4461, ST_AsTWKB doesn't always remove duplicate points (Nik Aven)
+  - #4459, Fix ST_Subdivide crash on intermediate EMPTY (Darafei Praliaskouski)
 
 
+
 PostGIS 2.5.2
 2019/03/11
 

Modified: branches/2.5/liblwgeom/lwgeom.c
===================================================================
--- branches/2.5/liblwgeom/lwgeom.c	2019-08-04 07:08:37 UTC (rev 17667)
+++ branches/2.5/liblwgeom/lwgeom.c	2019-08-04 07:19:22 UTC (rev 17668)
@@ -2271,8 +2271,11 @@
 	double center = DBL_MAX;
 	LWPOLY *lwpoly = NULL;
 	LWGEOM *clipped;
-
-	gbox_duplicate(lwgeom_get_bbox(geom), &clip);
+	const GBOX *box_in;
+	if (!geom) return 0;
+	box_in = lwgeom_get_bbox(geom);
+	if (!box_in) return 0;
+	gbox_duplicate(box_in, &clip);
 	width = clip.xmax - clip.xmin;
 	height = clip.ymax - clip.ymin;
 



More information about the postgis-tickets mailing list