[postgis-tickets] r17285 - Hm, every proj call really needs a NULL guard :/

Paul Ramsey pramsey at cleverelephant.ca
Wed Feb 27 08:03:59 PST 2019


Author: pramsey
Date: 2019-02-27 08:03:59 -0800 (Wed, 27 Feb 2019)
New Revision: 17285

Modified:
   trunk/liblwgeom/lwgeom_transform.c
Log:
Hm, every proj call really needs a NULL guard :/


Modified: trunk/liblwgeom/lwgeom_transform.c
===================================================================
--- trunk/liblwgeom/lwgeom_transform.c	2019-02-27 12:49:49 UTC (rev 17284)
+++ trunk/liblwgeom/lwgeom_transform.c	2019-02-27 16:03:59 UTC (rev 17285)
@@ -304,6 +304,7 @@
 	if (proj_get_type(pj_crs) == PJ_TYPE_COMPOUND_CRS)
 	{
 		PJ *pj_horiz_crs = proj_crs_get_sub_crs(NULL, pj_crs, 0);
+		assert(pj_horiz_crs);
 		pj_cs = proj_crs_get_coordinate_system(NULL, pj_horiz_crs);
 		proj_destroy(pj_horiz_crs);
 	}
@@ -310,6 +311,7 @@
 	else if (proj_get_type(pj_crs) == PJ_TYPE_BOUND_CRS)
 	{
 		PJ *pj_src_crs = proj_get_source_crs(NULL, pj_crs);
+		assert(pj_src_crs);
 		pj_cs = proj_crs_get_coordinate_system(NULL, pj_src_crs);
 		proj_destroy(pj_src_crs);
 	}
@@ -317,6 +319,7 @@
 	{
 		pj_cs = proj_crs_get_coordinate_system(NULL, pj_crs);
 	}
+	assert(pj_cs);
 	int axis_count = proj_cs_get_axis_count(NULL, pj_cs);
 	if (axis_count > 0)
 	{



More information about the postgis-tickets mailing list