Commit d9a54238 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Kitware Robot

Merge topic '12788_fix_vtu_reader' into pv-master

823abd3c Fixed BUG #12788. Segfault when reading files with multiple pieces.
parents 1f519fe4 823abd3c
......@@ -282,8 +282,14 @@ int vtkXMLUnstructuredGridReader::ReadPieceData()
{
// this set the startLoc to point to the location in the cellArray where the
// cell for this piece will start writing.
startLoc = locations->GetValue(this->StartCell-1) +
cellArrayData->GetValue(locations->GetValue(this->StartCell-1));
// Id for last written cell:
vtkIdType lastWrittenCell = this->StartCell - 1;
vtkIdType locationOfLastWrittenCell = locations->GetValue(lastWrittenCell);
startLoc = locationOfLastWrittenCell + 1 +
cellArrayData->GetValue(locationOfLastWrittenCell);
// startLoc = location-of-last-written-cell + 1 (for put the count for items in the cell)
// + (number of items in the cell).
}
vtkIdType* begin = output->GetCells()->GetData()->GetPointer(startLoc);
vtkIdType* cur = begin;
......
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