From f696404ceb368546b566abc24ece49266c23629b Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 4 Mar 2020 18:28:04 +0300 Subject: [PATCH] #18803 [CEA 18712] Mesh.ReorientObject(groupVolumes) generates a SIGSEV with SMESH branch rnv/pv58_1 + ParaView 5.8 --- src/SMDS/SMDS_MeshVolume.cxx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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; } -- 2.39.2