vtkColorTransferFunction::GetTable race condition
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When vtkColorTransferFunction is used with vtkImageMapToColors a race condition can arise during running leading to corrupted output or a crash.
The issue is caused by the re-allocation and re-computation of the lookup table (LUT) performed in vtkColorTransferFunction::GetTable(). Because vtkImageMapToColors is a multi-threaded algorithm, GetTable can be called by many threads simultaneously. The re-allocation and computation should be protected with a mutex or critical section.
Only vtkImageData using unsigned char or unsigned short pixel data are affected.
My solution was to protect GetTable with a vtkCriticalSection.