View Issue Details

IDProjectCategoryView StatusLast Update
0026564CommunityOCCT:Modeling Algorithmspublic2015-08-16 20:11
Reportersrlockley Assigned Tojgv 
PrioritynormalSeveritycrash 
Status newResolutionopen 
PlatformWindowsOSVC++ 2013 
Product Version6.9.0 
Summary0026564: Unhandled null pointer in BRep_Tool.cxx
DescriptionI have several models that the BRep paving has problems with and they cause a crash in the Tolerance function of BRep_Tool.

It is suggested to test that the shape is not null before de-referencing the potentially null pointer with
p = (*((Handle(BRep_TFace)*)&F.TShape()))->Tolerance();

The following revision handles the problem and prevents a crash, but I am unsure why the null shape arrives in the first place

Standard_Real BRep_Tool::Tolerance(const TopoDS_Face& F)
{
    Standard_Real pMin = Precision::Confusion();
    Standard_Real p = pMin;
    if ((*((Handle(BRep_TFace)*)&F.TShape())) != nullptr)
        p = (*((Handle(BRep_TFace)*)&F.TShape()))->Tolerance();
    else
        Standard_ConstructionError::Raise("TopoDS_Face::TShape is null");
    if (p > pMin) return p;
    else return pMin;
}
TagsNo tags attached.
Test case number

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2015-08-16 20:11 srlockley New Issue
2015-08-16 20:11 srlockley Assigned To => jgv