Skip to content
Snippets Groups Projects
Commit 01bade26 authored by Bill Lorensen's avatar Bill Lorensen Committed by Code Review
Browse files

Merge topic 'Segfault_PlotBox' into master

b3470426 BUG: CreateDefaultLookupTable crashes if Input is NULL.
parents dd6ee504 b3470426
No related branches found
No related tags found
No related merge requests found
......@@ -387,18 +387,22 @@ void vtkPlotBox::SetColumnColor(const vtkStdString& colName, double *rgb)
//-----------------------------------------------------------------------------
void vtkPlotBox::CreateDefaultLookupTable()
{
if (this->LookupTable)
// There must be an input to create a lookup table
if (this->GetInput())
{
this->LookupTable->UnRegister(this);
if (this->LookupTable)
{
this->LookupTable->UnRegister(this);
}
vtkLookupTable* lut = vtkLookupTable::New();
this->LookupTable = lut;
// Consistent Register/UnRegisters.
this->LookupTable->Register(this);
this->LookupTable->Delete();
vtkTable *table = this->GetInput();
lut->SetNumberOfColors(table->GetNumberOfColumns());
this->LookupTable->Build();
}
vtkLookupTable* lut = vtkLookupTable::New();
this->LookupTable = lut;
// Consistent Register/UnRegisters.
this->LookupTable->Register(this);
this->LookupTable->Delete();
vtkTable *table = this->GetInput();
lut->SetNumberOfColors(table->GetNumberOfColumns());
this->LookupTable->Build();
}
//-----------------------------------------------------------------------------
......
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