Commit 6ccc95c9 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

Avoid segfaults for multiblocks of vtkTable.

This overcomes segfaults when the input is a multiblock of vtkTable or
other non-vtkDataSet instances.
parent 3d3f264c
......@@ -202,8 +202,8 @@ int vtkProgrammableFilter::RequestData(
vtkCompositeDataIterator* iter = cdsInput->NewIterator();
for(iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
{
vtkDataSet* iblock = vtkDataSet::SafeDownCast(iter->GetCurrentDataObject());
vtkDataSet* oblock = iblock->NewInstance();
vtkDataObject* iblock = iter->GetCurrentDataObject();
vtkDataObject* oblock = iblock->NewInstance();
if (iblock)
{
if (this->CopyArrays)
......@@ -212,7 +212,12 @@ int vtkProgrammableFilter::RequestData(
}
else
{
oblock->CopyStructure( iblock );
vtkDataSet* iblockDS = vtkDataSet::SafeDownCast(iblock);
vtkDataSet* oblockDS = vtkDataSet::SafeDownCast(oblock);
if (iblockDS && oblockDS)
{
oblockDS->CopyStructure(iblockDS);
}
}
}
cdsOutput->SetDataSet(iter, oblock);
......
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