PG_RETURN_POINTER(ingeom);
}
+ if ( dist <= 0 ) {
+ /* Protect from knowingly infinite loops, see #1799 */
+ /* Note that we'll end out of memory anyway for other small distances */
+ elog(ERROR, "ST_Segmentize: invalid max_distance %g (must be >= 0)", dist);
+ PG_RETURN_NULL();
+ }
+
inlwgeom = lwgeom_from_gserialized(ingeom);
outlwgeom = lwgeom_segmentize2d(inlwgeom, dist);
) SELECT '#1791', round(ST_Azimuth(a,b)*10)/10 from inp;
+-- #1799 --
+SELECT '#1799', ST_Segmentize('LINESTRING(0 0, 10 0)'::geometry, 0);
+
-- Clean up
DELETE FROM spatial_ref_sys;
#1755|01010000A0E6100000000000000040554000000000008041400000000000000000
#1776|POLYGON((0 0,10 0,10 10,0 0))|POLYGON((0 0,10 0,10 10,0 0))
#1791|4.7
+ERROR: ST_Segmentize: invalid max_distance 0 (must be >= 0)