1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-05 18:16:23 +03:00

0024640: Broken logic of check of variable for zero in IntCurvesFace_Intersector constructor

The check is fixed to avoid FPE division by zero
This commit is contained in:
abv 2014-02-19 08:54:49 +04:00 committed by apn
parent ecba6de3cc
commit 7eb732b683

View File

@ -95,7 +95,7 @@ IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face,
Standard_Boolean bFlag;
//
{
Standard_Real dU, dV, dA, dB, aR, aTresh;
Standard_Real dU, dV, dA, dB, aTresh;
bFlag=Standard_True;
//
aTresh=100.;
@ -108,15 +108,9 @@ IntCurvesFace_Intersector::IntCurvesFace_Intersector(const TopoDS_Face& Face,
dB=dU;
}
//
aR=dA/dB;
if (dB<Precision::PConfusion()) {
if (dB < Precision::PConfusion() || dA > dB * aTresh) {
bFlag=!bFlag;
}
else {
if (aR>aTresh) {
bFlag=!bFlag;
}
}
}
//
if (bFlag) {