Commit cb0ba4c4 authored by David Partyka's avatar David Partyka
Browse files

Merge branch 'stencil-iterator-segfault' into release

parents ffe850c1 dd83524a
......@@ -115,6 +115,10 @@ void vtkImageStencilIterator<DType>::Initialize(
this->HasStencil = true;
this->InStencil = true;
this->SpanIndexX = 0;
this->SpanIndexY = 0;
this->SpanIndexZ = 0;
int stencilExtent[6];
stencil->GetExtent(stencilExtent);
......@@ -186,6 +190,9 @@ void vtkImageStencilIterator<DType>::Initialize(
this->SpanMaxZ = stencilExtent[5] - extent[4];
}
if (this->SpanMinY <= this->SpanMaxY &&
this->SpanMinZ <= this->SpanMaxZ)
{
this->SpanCountPointer =
vtkImageStencilIteratorFriendship::GetExtentListLengths(stencil) +
startOffset;
......@@ -194,13 +201,16 @@ void vtkImageStencilIterator<DType>::Initialize(
vtkImageStencilIteratorFriendship::GetExtentLists(stencil) +
startOffset;
this->SpanIndexX = 0;
this->SpanIndexY = 0;
this->SpanIndexZ = 0;
// Holds the current position within the span list for the current row
this->SetSpanState(this->SpanMinX);
}
else
{
this->SpanCountPointer = 0;
this->SpanListPointer = 0;
this->InStencil = false;
}
}
else
{
this->HasStencil = false;
......
Supports Markdown
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