Commit e8933ac1 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot
Browse files

Merge topic 'better_handle_multiblock_of_tables'

6ccc95c9

 Avoid segfaults for multiblocks of vtkTable.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Berk Geveci's avatarBerk Geveci <berk.geveci@kitware.com>
Merge-request: !426
parents f7e845a7 6ccc95c9
......@@ -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