vtkContourWidgetRepresentation crashes when faced with unexpected contour points upon initialization.
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
This is outside the normal operation of the Contour Widget, understandably: In the process of debugging my program, I have called vtkContourRepresentation::Initialize with point data that lies entirely outside the view volume.
What happens then is the problem:
-
vtkContourRepresentation throws away all the points in the current polyline.
-
In vtkContourRepresentation::UpdateContour, there's a call to vtkContourRepresentation::UpdateLines:
this->UpdateLine( this->Internal->Nodes.size()-1, 0);
Since the internal nodes are empty, this->Internal->Nodes.size() - 1 == -1. This causes a crash in UpdateLine, because it uses -1 as an index into this->Internal->Nodes ...