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