1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-06-05 11:24:17 +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
parent c4ffe7690d
commit 95432f985e

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) {