From: abn Date: Fri, 8 Oct 2021 13:48:11 +0000 (+0200) Subject: Bug fix ! X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=6952fe84d182a8bb749a4ec9a6663ad944e23ae5;p=tools%2Fmedcoupling.git Bug fix ! --- diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 3a63bc6d6..f4e1789e3 100755 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -2545,9 +2545,12 @@ void MEDCouplingUMesh::findCellsToRenumber(const MEDCouplingUMesh& otherDimM1OnS // Build map giving for each cell ID in mAroundGrp the corresponding cell ID on the other side of the crack: // Note that this does not cover all cells around the crack (a cell like a triangle might touche the crack only with its tip) std::map toOtherSide; - const mcIdType *revDP=revDesc00->begin(), *revDIP=revDescI00->begin(); + const mcIdType *revDP=revDesc00->begin(), *revDIP=revDescI00->begin(); + const mcIdType nCellsArGrpDesc = mArGrpDesc->getNumberOfCells(); for (const auto& v: *idsOfM1) { + if (v >= nCellsArGrpDesc) // Keep valid match only + continue; mcIdType idx0 = revDIP[v]; mcIdType c1=revDP[idx0], c2=revDP[idx0+1]; toOtherSide[c1] = c2;