Skip to content
Snippets Groups Projects
Commit 6637fd6c authored by David Gobbi's avatar David Gobbi
Browse files

Fix tree iterator resizing of Color array

Setting the size of an array is best done with SetNumberOfValues(),
since Resize() only changes the allocation but not the number of
items present.
parent 432053f7
No related branches found
No related tags found
2 merge requests!11541Branch for the v9.4.0 release,!11432Fixes for array access beyond MaxId
......@@ -49,7 +49,7 @@ void vtkTreeBFSIterator::Initialize()
return;
}
// Set all colors to white
this->Color->Resize(this->Tree->GetNumberOfVertices());
this->Color->SetNumberOfValues(this->Tree->GetNumberOfVertices());
for (vtkIdType i = 0; i < this->Tree->GetNumberOfVertices(); i++)
{
this->Color->SetValue(i, this->WHITE);
......
......@@ -65,7 +65,7 @@ void vtkTreeDFSIterator::Initialize()
return;
}
// Set all colors to white
this->Color->Resize(this->Tree->GetNumberOfVertices());
this->Color->SetNumberOfValues(this->Tree->GetNumberOfVertices());
for (vtkIdType i = 0; i < this->Tree->GetNumberOfVertices(); i++)
{
this->Color->SetValue(i, this->WHITE);
......
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