Skip to content
Snippets Groups Projects
Commit d9600788 authored by Julien Michel's avatar Julien Michel
Browse files

BUG: Ensure that SRS is not null before dereferencing

parent 9f06a583
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,7 @@ PersistentImageToOGRLayerFilter<TImage>
// the spatial reference of the input image
OGRSpatialReference oSRS(this->GetInput()->GetProjectionRef().c_str());
if(!oSRS.IsSame(m_OGRLayer.GetSpatialRef()))
if(m_OGRLayer.GetSpatialRef() && !oSRS.IsSame(m_OGRLayer.GetSpatialRef()))
{
itkExceptionMacro(<<"Spatial reference of input image and target layer do not match!");
}
......@@ -119,7 +119,7 @@ PersistentImageToOGRLayerFilter<TImage>
// Check spatial reference matches
if(!srcLayer.GetSpatialRef()->IsSame(m_OGRLayer.GetSpatialRef()))
if(srcLayer.GetSpatialRef() && m_OGRLayer.GetSpatialRef() && !srcLayer.GetSpatialRef()->IsSame(m_OGRLayer.GetSpatialRef()))
{
itkExceptionMacro(<<"Spatial reference of internal and target layers do not match!");
}
......
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