Commit f40b0263 authored by Julien Malik's avatar Julien Malik

BUG: protect against wrong mode

parent e8b4bc8b
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment