Skip to content
Snippets Groups Projects
Commit f40b0263 authored by Julien Malik's avatar Julien Malik
Browse files

BUG: protect against wrong mode

parent e8b4bc8b
No related branches found
No related tags found
No related merge requests found
......@@ -224,6 +224,11 @@ void DeleteDataSource(std::string const& datasourceName)
otb::ogr::DataSource::Pointer
otb::ogr::DataSource::New(std::string const& datasourceName, Modes::type mode)
{
if (mode < Modes::Read || mode >= Modes::MAX__)
{
itkGenericExceptionMacro(<< "Wrong mode when opening " << datasourceName);
}
Drivers::Init();
if (mode == Modes::Overwrite)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment