Opened 15 years ago
Closed 15 years ago
#3099 closed defect (fixed)
OGRBuildPolygonFromEdges() segfaults on MULTIPOLYGON inputs
Reported by: | dron | Owned by: | Even Rouault |
---|---|---|---|
Priority: | normal | Milestone: | 1.7.0 |
Component: | OGR_SF | Version: | unspecified |
Severity: | normal | Keywords: | |
Cc: | warmerdam |
Description
OGRBuildPolygonFromEdges() can't properly handle a case when the MULTIPOLYGON geometry supplied as an input. The test case follows:
#!/usr/bin/env python from osgeo import ogr g=ogr.Geometry(wkt="MULTIPOLYGON (((20 15,15 15,15 20,20 20,20 15)),((17 10,17 12,20 12, 20 10,17 10)))") ogr.BuildPolygonFromEdges(g, bAutoClose=1)
This script results in segmentation fault. I think that OGRBuildPolygonFromEdges() should either refuse to work with such a geometry or return a multipolygon as a result.
Best regards, Andrey
Change History (4)
comment:1 by , 15 years ago
Component: | default → OGR_SF |
---|
comment:2 by , 15 years ago
Cc: | added |
---|---|
Milestone: | → 1.7.0 |
Owner: | changed from | to
comment:3 by , 15 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Agreed.
Chaitanya, could you please modify the function (in gdal/ogr/ograssemblepolygon.cpp to error out in an informative way for non-linestring (or linearring) geometries in the passed in collection? Also, please extend the test suite with this change. It would be sufficient to do this in trunk.