Ticket #850 (closed defect: fixed)
GDALClose crash with ECW and MrSDI files.
| Reported by: | xpaytubi@… | Owned by: | warmerdam |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | GDAL_Raster | Version: | unspecified |
| Severity: | normal | Keywords: | ecw |
| Cc: | mloskot |
Description (last modified by mloskot) (diff)
Hi,
I'm using a gdal cvs checkout from last week, the last ECW sources and MrSID libraries. I've compiled the gdal and ecw library with /MDd option.
Description:
- When I try to close a ecw or mrsid file, GDALClose function crashes.
Reproduction:
- The call is like : GDALClose(theDataset); // theDataSet is a GDALDatasetH pointer.
Causes:
- ECW case: When GDALClose calls "delete poDS;" this calls the ECWDataset destructor. In this method, the "delete poFileView;" call crash.
If I comment the next piece of code:
// if( poFileView != NULL )
// {
// poUnderlyingIOStream = ((VSIIOStream* (poFileView->GetStream()));
// delete poFileView;
// }
not crash but there are memory leaks, of course, :-)
- MrSID case: When GDALClose calls "delete poDS;" this calls the MrSIDDataset destructor. In this method, various deletes crashes:
if ( poImageReader && !bIsOverview ) delete poImageReader; ............. if ( poMetadata ) delete poMetadata; ............. if ( papoOverviewDS ) { for( int i = 0; i < nOverviewCount; i++ ) delete papoOverviewDS[i]; CPLFree( papoOverviewDS ); }
and also crash in MrSIDRasterBand destructor:
if ( poPixel )
delete poPixel;
If I comment all those lines all works correctly but also there are memory leaks like the case of ecw.
Thanks a lot.
Change History
Note: See
TracTickets for help on using
tickets.
