Commit 17d7c1ef authored by David C. Lonie's avatar David C. Lonie
Browse files

Use valid pointer in vtkLookupTable::BuildSpecialColors.

The call to ResizeTableForSpecialColors resizes the Table array,
invalidating the pointers 'table' and 'tptr', leading to crashes:

https://open.cdash.org/testDetails.php?test=414805862&build=4211477
parent eac09abf
Pipeline #6501 passed with stage
......@@ -292,12 +292,12 @@ void vtkLookupTable::Build()
void vtkLookupTable::BuildSpecialColors()
{
// Add "special" colors (NaN, below range, above range) to table here.
unsigned char *table = this->GetTable()->GetPointer(0);
vtkIdType numberOfColors = this->GetTable()->GetNumberOfTuples();
unsigned char *tptr = table + 4*(numberOfColors + vtkLookupTable::BELOW_RANGE_COLOR_INDEX);
unsigned char color[4];
this->ResizeTableForSpecialColors();
unsigned char *table = this->GetTable()->GetPointer(0);
unsigned char *tptr = table + 4*(numberOfColors + vtkLookupTable::BELOW_RANGE_COLOR_INDEX);
unsigned char color[4];
// Below range color
if (this->GetUseBelowRangeColor() || numberOfColors == 0)
......
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