1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0030533: Data Exchange - Crash during STEP import.

Add Null checks to avoid crash during reading faces without bounds.
This commit is contained in:
ika
2019-02-28 17:56:47 +03:00
committed by apn
parent 6ef0d6f156
commit 7b93ae3c5e
2 changed files with 33 additions and 1 deletions

View File

@@ -4547,6 +4547,8 @@ void STEPCAFControl_Reader::ExpandShell(const Handle(StepShape_ConnectedFaceSet)
// Access face bounds
Handle(StepShape_HArray1OfFaceBound) aWires = aFace->Bounds();
if (aWires.IsNull())
continue;
for (Standard_Integer w = aWires->Lower(); w <= aWires->Upper(); ++w)
{
const Handle(StepShape_Loop)& aWire = aWires->Value(w)->Bound();
@@ -4564,7 +4566,12 @@ void STEPCAFControl_Reader::ExpandShell(const Handle(StepShape_ConnectedFaceSet)
Handle(StepShape_HArray1OfOrientedEdge) anEdges = anEdgeLoop->EdgeList();
for (Standard_Integer e = anEdges->Lower(); e <= anEdges->Upper(); ++e)
{
Handle(StepShape_Edge) anEdge = anEdges->Value(e)->EdgeElement();
Handle(StepShape_OrientedEdge) anOrientedEdge = anEdges->Value(e);
if (anOrientedEdge.IsNull())
continue;
Handle(StepShape_Edge) anEdge = anOrientedEdge->EdgeElement();
if (anEdge.IsNull())
continue;
// Record CAF data
SettleShapeData(anEdge, RootLab, ShapeTool, TP);