[Gdal-dev] OGR geometry transform memory issue

Brian Marchand bmarchand at ara.com
Mon Nov 10 09:25:14 EST 2003


Hello,

 

I found a crash in the OGR code due to freeing up the target
OGRSpatialReference object that is created by the
OGRCoordinateTransformation class when calling
OGRCreateCoordinateTransformation. The crash occurred when the geometry
transform method assigned the "target" OGRSpatialReference object that
was created by the transformation object. When I destroyed the
transformation object the OGRProj4CT destructor destroyed the
OGRSpatialReference and the geometry was then pointing to deleted
memory. The next time the geometry's SRS object was used I would get a
crash. 

 

It seems like the problem could be fixed two ways. Either the geometry
clones the OGRSpatialReference object instead of assigning it, or the
OGRCoordinateTransformation object looks at the reference count of the
target OGRSpatialReference object before deleting it. 

 

I'm using version 1.1.9 so I apologize if this has been reported and
fixed already. 

 

Brian 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20031110/4f15c727/attachment.html


More information about the Gdal-dev mailing list