Skip to content
Snippets Groups Projects
Commit b3470426 authored by Bill Lorensen's avatar Bill Lorensen
Browse files

BUG: CreateDefaultLookupTable crashes if Input is NULL.

TestSetGet.tcl segfaulted when calling GetLookupTable().
GetLookupTable() calls CreateDefaultLookupTable() which requires a
non NULL Input.

Change-Id: I615ec5b386d75d5b64f636156d0006ed15e093a0
parent dd6ee504
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