Skip to content
Snippets Groups Projects
Commit 1c787973 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

Fix uninitialized memory reported by valgrind.

23dff2bd introduced a bug where it didn't copy the point data correctly
for all the layers. Fixed that.
parent 71ab7e7b
No related branches found
No related tags found
No related merge requests found
......@@ -668,13 +668,15 @@ int vtkNetCDFCAMReader::RequestData(
pointData->CopyAllocate(output->GetPointData(),
output->GetNumberOfPoints());
vtkIdType newPtId = numFilePoints;
vtkIdType newPtId=0;
for (std::vector<vtkIdType>::const_iterator it=
boundaryPoints.begin(); it!=boundaryPoints.end(); ++it, ++newPtId)
{
for(long lev=0;lev<numLocalCellLevels+1-this->SingleLevel;lev++)
{
pointData->CopyData(pointData, (*it), newPtId);
vtkIdType srcId = (*it) + lev * numPointsPerLevel;
vtkIdType destId = (newPtId + numFilePoints) + lev * numPointsPerLevel;
pointData->CopyData(pointData, srcId, destId);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment