vtkGenericEnSightReader.cxx segfault
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When we try to open the geometry file contained in the case file, if the FILE pointer is NULL, the fclose lead to a segmentation fault (see the code that follow). Moreover, why assuming the file is binary whereas it can simply be absent...
Another problem - to my mind - is the return of vtkGenericEnSightReader::ENSIGHT_6_BINARY (returned 0=ENSIGHT_6 in VTK4.2) : the reading of the case file will continue with the reading of the variable files which is totally useless because we have no geometry. It should be intersting to use the VTK_OK and VTK_ERROR flags (as it is done in PLOT3DReader) to stop the update or the execute.
in VTK4.4 line 466 this->IFile = fopen(sfilename.c_str(), "rb"); if (this->IFile == NULL) { vtkErrorMacro("Unable to open file: " << sfilename.c_str()); vtkWarningMacro("Assuming binary file."); fclose(this->IFile); this->IFile = NULL; delete [] fileName; return vtkGenericEnSightReader::ENSIGHT_6_BINARY; } // end if IFile == NULL