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

0024934: Section: crash for two faces

Added protection from null vertexes.

Test case for issue CR24934
This commit is contained in:
aml 2014-11-05 17:26:31 +03:00 committed by bugmaster
parent 2c5b6d9c12
commit 2958244411
2 changed files with 26 additions and 0 deletions

View File

@ -671,6 +671,11 @@ Standard_Boolean ShapeAnalysis_Wire::CheckSmall (const Standard_Integer num,
TopoDS_Vertex V1 = sae.FirstVertex (E);
TopoDS_Vertex V2 = sae.LastVertex (E);
if (V1.IsNull() || V2.IsNull())
{
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_FAIL2);
return Standard_False;
}
gp_Pnt p1 = BRep_Tool::Pnt (V1);
gp_Pnt p2 = BRep_Tool::Pnt (V2);
Standard_Real dist = p1.Distance(p2);
@ -1847,6 +1852,11 @@ Standard_Boolean isMultiVertex(const TopTools_ListOfShape& alshape,
TopoDS_Edge aedge = myWire->Edge(i);
TopoDS_Vertex aV1,aV2;
TopExp::Vertices(aedge,aV1,aV2);
if (aV1.IsNull() || aV2.IsNull())
{
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_FAIL2);
return Standard_False;
}
Standard_Boolean isSame = aV1.IsSame(aV2);
if(myWire->IsSeam(i))
aMapSeemEdges.Add(aedge); ///continue;

16
tests/bugs/heal/bug24934 Normal file
View File

@ -0,0 +1,16 @@
puts "============"
puts "OCC24934"
puts "============"
puts ""
######################################################
# Section: crash for two faces
######################################################
restore [locate_data_file bug24934_f1.brep] f1
set info [fixshape ff1 f1]
if { [regexp "Exception" $info] != 0 } {
puts "Error : Exception in \"fixshape\" command was caught"
} else {
puts "OK: Command \"fixshape\" work properly"
}