From a64619aa7c1b5f7061c0084faaf3ae437f1e9399 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Fri, 7 Nov 2008 13:54:21 +0000 Subject: [PATCH] After a quick sanity grep, I noticed that ST_Transform() was also susceptible to crashing on curve types in the same way as the previous two fixes. Hence I'm committing a fix now before Regina finds it and logs another bug report :) git-svn-id: http://svn.osgeo.org/postgis/branches/1.3@3274 b70326c6-7e19-0410-871a-916f4a2858ee --- lwgeom/lwgeom_transform.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lwgeom/lwgeom_transform.c b/lwgeom/lwgeom_transform.c index 7c966b8a1..e2b2370ae 100644 --- a/lwgeom/lwgeom_transform.c +++ b/lwgeom/lwgeom_transform.c @@ -750,6 +750,7 @@ lwgeom_transform_recursive(uchar *geom, PJ *inpj, PJ *outpj) LWLINE *line=NULL; LWPOINT *point=NULL; LWPOLY *poly=NULL; + LWCURVE *curve=NULL; POINT4D p; uchar *subgeom=NULL; @@ -795,6 +796,20 @@ lwgeom_transform_recursive(uchar *geom, PJ *inpj, PJ *outpj) continue; } + curve = lwgeom_getcurve_inspected(inspected, j); + if (curve != NULL) + { + POINTARRAY *pts = curve->points; + for (i=0; inpoints; i++) + { + getPoint4d_p(pts, i, &p); + transform_point(&p, inpj, outpj); + setPoint4d(pts, i, &p); + } + lwgeom_release((LWGEOM *)curve); + continue; + } + subgeom = lwgeom_getsubgeometry_inspected(inspected, j); if ( subgeom != NULL ) { -- 2.40.0