Commit 25f0495b authored by David C. Lonie's avatar David C. Lonie
Browse files

Fix invalid array accesses in generic filters.

The secondaryPd object was reset after inserting each point,
rather than inbetween each cell, so the clip/contour calls
were only had the last inserted point's scalar data available,
rather than the complete cell.
parent 7b010075
......@@ -430,6 +430,7 @@ void vtkGenericAdaptorCell::Contour(vtkContourValues *contourValues,
{
assert("check: valid number of points" && npts == ptsCount);
range[1] = range[0] = scalars->GetComponent(dataIndex,currComp);
secondaryPd->Reset();
for(i=0; i<ptsCount; i++, point+=3)
{
linearCell->PointIds->SetId(i, pts[i]);
......@@ -448,7 +449,6 @@ void vtkGenericAdaptorCell::Contour(vtkContourValues *contourValues,
range[0] = range[0] < contVal ? range[0] : contVal;
range[1] = range[1] > contVal ? range[1] : contVal;
// for each point-centered attribute
secondaryPd->Reset();
j=0;
while(j<c)
{
......@@ -651,6 +651,7 @@ void vtkGenericAdaptorCell::Clip(double value,
this->InternalCellArray->GetNextCell(npts, pts);)
{
assert("check: valid number of points" && npts == ptsCount);
secondaryPd->Reset();
for(i=0; i<ptsCount; i++, point+=3)
{
linearCell->PointIds->SetId(i, pts[i]);
......@@ -667,7 +668,6 @@ void vtkGenericAdaptorCell::Clip(double value,
// current linear simplex.
// for each point-centered attribute
secondaryPd->Reset();
j=0;
while(j<c)
{
......
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