Commit eeccea8e authored by Bill Lorensen's avatar Bill Lorensen
Browse files

BUG: Use of uninitialised value of size 8

This valgrind defect has been present for years.

There are instances where vtkDoubleScreenEdge::Case is not defined
before RasterizeTriangle. The logic in vtkSimpleScreenEdge::Init is
complex. Perhaps in the future, a more more extensive examination will
uncover the real problem. For now, the patch fixes the valgrind defect
and still passes the regression test.

Change-Id: If8a9846d1a4561447d39078daa70c5acebd8f394
parent 75e300af
......@@ -250,7 +250,8 @@ enum
VTK_CASE_VERTICAL_IN_TO_OUT, // with edge equation
VTK_CASE_VERTICAL_OUT_TO_IN,
VTK_CASE_HORIZONTAL_IN_TO_OUT,
VTK_CASE_HORIZONTAL_OUT_TO_IN
VTK_CASE_HORIZONTAL_OUT_TO_IN,
VTK_CASE_UNDEFINED
};
// We use an edge equation as described in:
......@@ -277,6 +278,10 @@ class vtkSimpleScreenEdge
: public vtkScreenEdge
{
public:
vtkSimpleScreenEdge()
{
this->Case = VTK_CASE_UNDEFINED;
}
// Initialize the edge by the vertices v0 and v2 (ordered in y)
// `onRight' is true if the edge in on the right side of the triangle.
void Init(vtkVertexEntry *v0,
......@@ -1101,6 +1106,8 @@ public:
this->Zview+=this->ZStep;
}
break;
default:
vtkGenericWarningMacro(<< "Undefined edge case");
}
}
......
Supports Markdown
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