Re: [gdal-dev] GDALDataset::CopyLayer options handling causing crash

2020-02-11 Thread Even Rouault
Dirk, > How is this supported to be handled? How can the caller know the options > array has been destroyed by the CopyLayer function? This is a GDAL bug. This couldn't work. And there was no test for this feature. Fix & small test just committed in master and 3.0 branch Even -- Spatialys - G

[gdal-dev] GDALDataset::CopyLayer options handling causing crash

2020-02-11 Thread Dirk Vanden Boer
I get a crash when calling the CopyLayer function. Pseudo code: char** options = CSLAddString(nullptr, "DST_SRSWKT=some_wkt"); ds->CopyLayer(srcLayer, "newname", options); CSLDestroy(options); Inside GDALDataset::CopyLayer the DST_SRSWKT option is removed from the list: // Remove DST_WKT from opti