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

0027404: Data Exchange - access violation when reading STEP file

Added check on the null handle
Test case for issue CR27404
This commit is contained in:
gka
2016-10-27 17:50:18 +03:00
committed by apn
parent ee905e847d
commit a965c45b2d
2 changed files with 25 additions and 8 deletions

View File

@@ -271,14 +271,17 @@ Standard_Integer STEPControl_Reader::NbRootsForTransfer()
Handle(StepShape_ShapeRepresentation)::DownCast(RR->Rep1());
if(SR==SR2)
SR2 = Handle(StepShape_ShapeRepresentation)::DownCast(RR->Rep2());
Interface_EntityIterator subs2 = graph.Sharings(SR2);
for(subs2.Start(); subs2.More(); subs2.Next()) {
Handle(StepShape_ShapeDefinitionRepresentation) SDR2 =
Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(subs2.Value());
if(!SDR2.IsNull()) IsRoot = Standard_False;
//else {
// if(SR==SRR->Rep2()) IsRoot = Standard_False;
//}
if(!SR2.IsNull())
{
Interface_EntityIterator subs2 = graph.Sharings(SR2);
for(subs2.Start(); subs2.More(); subs2.Next()) {
Handle(StepShape_ShapeDefinitionRepresentation) SDR2 =
Handle(StepShape_ShapeDefinitionRepresentation)::DownCast(subs2.Value());
if(!SDR2.IsNull()) IsRoot = Standard_False;
//else {
// if(SR==SRR->Rep2()) IsRoot = Standard_False;
//}
}
}
}
}