Lack of management if GDALOpen fails
Mantis Issue 308, reported by smay, assigned to smay, created: 2011-05-20
In Code/IO/otbGDALImageIO.cxx Section : GDALDatasetWrapper::Pointer Open( std::string filename ) const
if (dataset != NULL) { datasetWrapper = GDALDatasetWrapper::New(); datasetWrapper->m_Dataset = static_cast<GDALDataset*>(dataset); }
=> If dataset is Null, datasetWrapper is not set. ==> Action : Modify code to insert default value.
1306140746 - julienmdatasetWrapper is well initialized in the case where GDALOpen fails : it is initialized to a null (smart) pointer. you can check its validity with standard SmartPointer methods (IsNull, IsNotNull)
The IsNull/IsNotNull check is done in CanReadFile and InternalWriteImageInformation, returning an exception when necessary.
Can you please describe in what situation you got a problem, with steps/piece of code to reproduce the bug ?
1306236104 - stephaneOK with you answer.
I have a problem in this function : GDALDatasetWrapper::Pointer Open( std::string filename ) const
With the following line : poDataset = (GDALDataset *) GDALOpen(filename.c_str(), GA_ReadOnly);
I open another thread.
1306239033 - julienmSo we can close this thread ?