]> granicus.if.org Git - postgis/commitdiff
Hm, every proj call really needs a NULL guard :/
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 27 Feb 2019 16:03:59 +0000 (16:03 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 27 Feb 2019 16:03:59 +0000 (16:03 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@17285 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwgeom_transform.c

index 4ce3c6cd47173dfebb4d6d9e65b62e9e99499003..eb723c692a6b26fed773da2b77df590580f11001 100644 (file)
@@ -304,12 +304,14 @@ proj_crs_is_swapped(const PJ* pj_crs)
        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);
        }
        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 @@ proj_crs_is_swapped(const PJ* pj_crs)
        {
                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)
        {