Skip to content
Snippets Groups Projects
Commit 4d0b8189 authored by David E DeMarle's avatar David E DeMarle
Browse files

Merge branch 'fix_valgrind_issues_with_cam_reader' into 'master'

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.

See merge request !438
parents 71ab7e7b 1c787973
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.
Please register or to comment