[CEA 18712] Mesh.ReorientObject(groupVolumes) generates a SIGSEV with SMESH branch rnv/pv58_1 + ParaView 5.8

This commit is contained in:
eap 2020-03-04 18:28:04 +03:00
parent 78db25bc6b
commit f696404ceb

@ -82,10 +82,9 @@ bool SMDS_MeshVolume::ChangeNodes(const std::vector<const SMDS_MeshNode*>& nodes
return false; return false;
vtkIdType nFaces = 0; vtkIdType nFaces = 0;
vtkIdType *ptIds;
vtkIdType const *tmp(nullptr); vtkIdType const *tmp(nullptr);
getGrid()->GetFaceStream( GetVtkID(), nFaces, tmp ); getGrid()->GetFaceStream( GetVtkID(), nFaces, tmp );
std::copy(tmp, tmp+nFaces, ptIds); vtkIdType *ptIds = const_cast<vtkIdType*>( tmp );
// stream size and nb faces should not change // stream size and nb faces should not change
@ -93,14 +92,14 @@ bool SMDS_MeshVolume::ChangeNodes(const std::vector<const SMDS_MeshNode*>& nodes
{ {
return false; return false;
} }
int id = 0, nbPoints = 0; size_t id = 0, nbPoints = 0;
for ( int i = 0; i < nFaces; i++ ) for ( int i = 0; i < nFaces; i++ )
{ {
int nodesInFace = ptIds[id]; int nodesInFace = ptIds[id];
nbPoints += nodesInFace; nbPoints += nodesInFace;
id += (nodesInFace + 1); id += (nodesInFace + 1);
} }
if ((int) nodes.size() != nbPoints ) if ( nodes.size() != nbPoints )
{ {
return false; return false;
} }