From: eap Date: Wed, 4 Mar 2020 15:28:04 +0000 (+0300) Subject: #18803 [CEA 18712] Mesh.ReorientObject(groupVolumes) generates a SIGSEV with SMESH... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f696404ceb368546b566abc24ece49266c23629b;p=modules%2Fsmesh.git #18803 [CEA 18712] Mesh.ReorientObject(groupVolumes) generates a SIGSEV with SMESH branch rnv/pv58_1 + ParaView 5.8 --- diff --git a/src/SMDS/SMDS_MeshVolume.cxx b/src/SMDS/SMDS_MeshVolume.cxx index d684a5638..1c6ee20db 100644 --- a/src/SMDS/SMDS_MeshVolume.cxx +++ b/src/SMDS/SMDS_MeshVolume.cxx @@ -82,10 +82,9 @@ bool SMDS_MeshVolume::ChangeNodes(const std::vector& nodes return false; vtkIdType nFaces = 0; - vtkIdType *ptIds; vtkIdType const *tmp(nullptr); getGrid()->GetFaceStream( GetVtkID(), nFaces, tmp ); - std::copy(tmp, tmp+nFaces, ptIds); + vtkIdType *ptIds = const_cast( tmp ); // stream size and nb faces should not change @@ -93,14 +92,14 @@ bool SMDS_MeshVolume::ChangeNodes(const std::vector& nodes { return false; } - int id = 0, nbPoints = 0; + size_t id = 0, nbPoints = 0; for ( int i = 0; i < nFaces; i++ ) { int nodesInFace = ptIds[id]; nbPoints += nodesInFace; id += (nodesInFace + 1); } - if ((int) nodes.size() != nbPoints ) + if ( nodes.size() != nbPoints ) { return false; }