MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0026564Community[OCCT] OCCT:Modeling Algorithmspublic2015-08-16 20:112015-08-16 20:11
Reportersrlockley 
Assigned Tojgv 
PrioritynormalSeveritycrash 
StatusnewResolutionopen 
PlatformWindowsOSVC++ 2013OS Version32 bit
Product Version[OCCT] 6.9.0 
Target VersionFixed in Version 
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
Attached Files

- Relationships

-  Notes
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


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker