[postgis-tickets] r16148 - Move input_srid == output_srid check after input_srid is initialized

Regina Obe lr at pcorp.us
Tue Dec 12 14:16:55 PST 2017


Author: robe
Date: 2017-12-12 14:16:55 -0800 (Tue, 12 Dec 2017)
New Revision: 16148

Modified:
   trunk/postgis/lwgeom_transform.c
Log:
Move input_srid == output_srid check after input_srid is initialized
Closes #3940

Modified: trunk/postgis/lwgeom_transform.c
===================================================================
--- trunk/postgis/lwgeom_transform.c	2017-12-12 18:10:09 UTC (rev 16147)
+++ trunk/postgis/lwgeom_transform.c	2017-12-12 22:16:55 UTC (rev 16148)
@@ -59,12 +59,15 @@
 		PG_RETURN_NULL();
 	}
 
+	geom = PG_GETARG_GSERIALIZED_P_COPY(0);
+	input_srid = gserialized_get_srid(geom);
+
+	/* Moved this back down after input_srid set otherwise FreeBSD 11 (bessie goes nuts)
+	  Refer to https://trac.osgeo.org/postgis/ticket/3940 */
 	/* Input SRID and output SRID are equal, noop */
 	if ( input_srid == output_srid )
 		PG_RETURN_POINTER(PG_GETARG_DATUM(0));
 
-	geom = PG_GETARG_GSERIALIZED_P_COPY(0);
-	input_srid = gserialized_get_srid(geom);
 	if ( input_srid == SRID_UNKNOWN )
 	{
 		PG_FREE_IF_COPY(geom, 0);
@@ -72,6 +75,8 @@
 		PG_RETURN_NULL();
 	}
 
+
+
 	if ( GetProjectionsUsingFCInfo(fcinfo, input_srid, output_srid, &input_pj, &output_pj) == LW_FAILURE )
 	{
 		PG_FREE_IF_COPY(geom, 0);



More information about the postgis-tickets mailing list