1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0031125: BRepMesh_IncrementalMesh crash in constructor for empty compound shape

Added check for cases of empty shapes producing null models.
NoError status is returned as far as empty compounds are generally coorect shapes.
This commit is contained in:
oan 2019-11-04 17:49:07 +03:00 committed by bugmaster
parent b31fbc832d
commit 7756fc599d
2 changed files with 17 additions and 7 deletions

View File

@ -108,15 +108,18 @@ void BRepMesh_IncrementalMesh::Perform(const Handle(IMeshTools_Context)& theCont
myStatus = IMeshData_NoError;
const Handle(IMeshData_Model)& aModel = theContext->GetModel();
for (Standard_Integer aFaceIt = 0; aFaceIt < aModel->FacesNb(); ++aFaceIt)
if (!aModel.IsNull())
{
const IMeshData::IFaceHandle& aDFace = aModel->GetFace(aFaceIt);
myStatus |= aDFace->GetStatusMask();
for (Standard_Integer aWireIt = 0; aWireIt < aDFace->WiresNb(); ++aWireIt)
for (Standard_Integer aFaceIt = 0; aFaceIt < aModel->FacesNb(); ++aFaceIt)
{
const IMeshData::IWireHandle& aDWire = aDFace->GetWire(aWireIt);
myStatus |= aDWire->GetStatusMask();
const IMeshData::IFaceHandle& aDFace = aModel->GetFace(aFaceIt);
myStatus |= aDFace->GetStatusMask();
for (Standard_Integer aWireIt = 0; aWireIt < aDFace->WiresNb(); ++aWireIt)
{
const IMeshData::IWireHandle& aDWire = aDFace->GetWire(aWireIt);
myStatus |= aDWire->GetStatusMask();
}
}
}

7
tests/bugs/mesh/bug31125 Normal file
View File

@ -0,0 +1,7 @@
puts "======="
puts "0031125: BRepMesh_IncrementalMesh crash in constructor for empty compound shape"
puts "======="
puts ""
compound result
incmesh result 1