Commit 692d55a0 authored by Mathieu Malaterre's avatar Mathieu Malaterre
Browse files

BUG: Fix a very special case where there is only strips and no polys therefore...

BUG: Fix a very special case where there is only strips and no polys therefore maxCellSize was zero and new int[0] lead to delete[] which would eventually seg fault...
parent 8f9b3d91
......@@ -29,7 +29,7 @@
#include <float.h>
vtkCxxRevisionMacro(vtkBandedPolyDataContourFilter, "1.53");
vtkCxxRevisionMacro(vtkBandedPolyDataContourFilter, "1.54");
vtkStandardNewMacro(vtkBandedPolyDataContourFilter);
// Construct object.
......@@ -466,6 +466,10 @@ int vtkBandedPolyDataContourFilter::RequestData(
// Set up structures for processing polygons
maxCellSize = polys->GetMaxCellSize();
if( maxCellSize == 0 )
{
maxCellSize = input->GetStrips()->GetMaxCellSize();
}
maxCellSize *= (1 + this->NumberOfClipValues);
vtkIdType *newPolygon = new vtkIdType [maxCellSize];
......
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