Commit e2dad201 authored by Sean McBride's avatar Sean McBride

Fixed null dereference

Body of an ‘if’ set ‘ef = null’ then next ‘if’
unconditionally dereferenced it.

Change-Id: I1decc17579c5c9f7d3bfc5c5dc45ebb328573529
parent c5917828
......@@ -268,18 +268,15 @@ void vtkPrimitivePainter::RenderInternal(vtkRenderer* renderer,
// Edge flag
ef = input->GetPointData()->GetAttribute(vtkDataSetAttributes::EDGEFLAG);
if (ef)
if (ef && ef->GetNumberOfComponents() != 1)
{
if (ef->GetNumberOfComponents() != 1)
{
vtkDebugMacro(<< "Currently only 1d edge flags are supported.");
ef = NULL;
}
if (!ef->IsA("vtkUnsignedCharArray"))
{
vtkDebugMacro(<< "Currently only unsigned char edge flags are suported.");
ef = NULL;
}
vtkDebugMacro(<< "Currently only 1d edge flags are supported.");
ef = NULL;
}
if (ef && !ef->IsA("vtkUnsignedCharArray"))
{
vtkDebugMacro(<< "Currently only unsigned char edge flags are suported.");
ef = NULL;
}
// Set the flags
......
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