Ticket #254 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

ST_Segmentize crashes with empty geometry collections

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 1.4.1
Component: postgis Version: trunk
Keywords: Cc:

Description

SELECT ST_Segmentize(ST_GeomFromText('GEOMETRYCOLLECTION EMPTY'), 0.5);

Breaks on both 1.4 and 1.5 on my PostgreSQL 8.4 windows install. Though I don't have a 1.3 handy to test.

Attachments

segmentize.patch Download (426 bytes) - added by strk 4 years ago.
Suggested patch

Change History

Changed 4 years ago by strk

Try this:

Index: liblwgeom/lwcollection.c =================================================================== --- liblwgeom/lwcollection.c (revision 4541) +++ liblwgeom/lwcollection.c (working copy) @@ -321,7 +321,7 @@

unsigned int i; LWGEOM **newgeoms;

- if ( ! col->ngeoms ) return col; + if ( ! col->ngeoms ) return lwcollection_clone(col);

newgeoms = lwalloc(sizeof(LWGEOM *)*col->ngeoms); for (i=0; i<col->ngeoms; i++)

Changed 4 years ago by strk

Suggested patch

Changed 4 years ago by strk

  • status changed from new to closed
  • resolution set to fixed

Committed togheter with regression test in r4542.

Changed 4 years ago by robe

backported to branck 1.4 -- r4545 (didn't bother backporting the regress test).

Note: See TracTickets for help on using tickets.