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

COV: Fixing remaining coverity issues in Application engine (structurally dead...

COV: Fixing remaining coverity issues in Application engine (structurally dead code and unchecked dynamic cast)
parent c092eb65
No related branches found
No related tags found
No related merge requests found
......@@ -156,8 +156,8 @@ InputProcessXMLParameter::Read(Application::Pointer this_)
if (!doc.LoadFile(fp , TIXML_ENCODING_UTF8))
{
itkExceptionMacro(<< "Can't open file " << m_FileName);
fclose(fp);
itkExceptionMacro(<< "Can't open file " << m_FileName);
}
TiXmlHandle handle(&doc);
......@@ -276,10 +276,13 @@ InputProcessXMLParameter::Read(Application::Pointer this_)
else if (type == ParameterType_OutputImage)
{
OutputImageParameter *paramDown = dynamic_cast<OutputImageParameter*>(param);
paramDown->SetFileName(value);
std::string pixTypeAsString = GetChildNodeTextOf(n_Parameter, "pixtype");
ImagePixelType outPixType = GetPixelTypeFromString(pixTypeAsString);
paramDown->SetPixelType(outPixType);
if(paramDown!=NULL)
{
paramDown->SetFileName(value);
std::string pixTypeAsString = GetChildNodeTextOf(n_Parameter, "pixtype");
ImagePixelType outPixType = GetPixelTypeFromString(pixTypeAsString);
paramDown->SetPixelType(outPixType);
}
}
else if (type == ParameterType_ComplexOutputImage)
{
......
......@@ -180,15 +180,19 @@ OutputProcessXMLParameter::Write(Application::Pointer app)
if (type == ParameterType_Empty)
{
EmptyParameter* eParam = dynamic_cast<EmptyParameter *> (param);
//Dont use app->HasUserValue which returns false always because of
//EmptyParameter::HasValue() is false for EmptyParameter
if(eParam->HasUserValue())
if(eParam!=NULL)
{
paramExists = true;
emptyValue = "false";
if( eParam->GetActive() )
//Dont use app->HasUserValue which returns false always because of
//EmptyParameter::HasValue() is false for EmptyParameter
if(eParam->HasUserValue())
{
emptyValue = "true";
paramExists = true;
emptyValue = "false";
if( eParam->GetActive() )
{
emptyValue = "true";
}
}
}
}
......@@ -207,8 +211,11 @@ OutputProcessXMLParameter::Write(Application::Pointer app)
{
OutputImageParameter *imgParam = dynamic_cast<OutputImageParameter *>(param);
value = imgParam->GetFileName();
ImagePixelType pixType = imgParam->GetPixelType();
pixelTypeAsString = pixelTypeToString(pixType);
if(imgParam!=NULL)
{
ImagePixelType pixType = imgParam->GetPixelType();
pixelTypeAsString = pixelTypeToString(pixType);
}
}
else if( type == ParameterType_InputImageList || type == ParameterType_InputFilenameList ||
type == ParameterType_InputVectorDataList || type == ParameterType_StringList ||
......
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