FIX FOR: Paraview crashes loading VTU files
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I've been unable to load several VTU files into Paraview 5.0.0-RC1. Compiled it from source (cloned from Git master branch) on Ubuntu 14.04 LTS and found the problem on the InsertPolygonInHash method of vtkDataSetSurfaceFilter. If the numPts parameter passed in is zero (which my data files apparently cause) the code will allocate a zero sized array of vtkIdTypes, which will cause undefined behaviour (a crash in my case) when dereferencing it later. I've added the following lines to prevent the crash, not sure if something else should be fixed also:
vtkFastGeomQuad *quad, **end;
- // Bail out if 'numPts' == 0, otherwise a crash will insue due to 'end = this->QuadHash + tab[0];'
- if (numPts == 0)
- {
- return;
- }
// find the index to the smallest id vtkIdType offset = 0;
This issue still exists in VTK's master repository as of today. Sorry for not providing a proper patch...