Skip to content

Commit

Permalink
Crash on collections with empty members, references #5646
Browse files Browse the repository at this point in the history
  • Loading branch information
pramsey committed Jan 10, 2024
1 parent efa5028 commit 4a05e74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -14,6 +14,7 @@ Proj 6.1+, and PostgreSQL 14+.
- #5604, Handle distance between collections with empty elements (Paul Ramsey)
- #5635, Handle NaN points in ST_Split (Regina Obe)
- Logic error in ST_Covers(geography) (Paul Ramsey)
- #5646, Crash on collections with empty members (Paul Ramsey)


PostGIS 3.2.6
Expand Down
3 changes: 3 additions & 0 deletions postgis/lwgeom_functions_analytic.c
Expand Up @@ -947,6 +947,9 @@ int point_in_multipolygon_rtree(RTREE_NODE **root, int polyCount, int *ringCount
/* is the point inside any of the sub-polygons? */
for ( p = 0; p < polyCount; p++ )
{
/* Skip empty polygons */
if( ringCounts[p] == 0 ) continue;

in_ring = point_in_ring_rtree(root[i], &pt);
POSTGIS_DEBUGF(4, "point_in_multipolygon_rtree: exterior ring (%d), point_in_ring returned %d", p, in_ring);
if ( in_ring == -1 ) /* outside the exterior ring */
Expand Down

0 comments on commit 4a05e74

Please sign in to comment.