1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0033304: Modeling Data - Floating point signal when converting a B-spline curve to analytical form

Protect the static function ConicDefinition from calling sqrt with negative argument.
This commit is contained in:
msv 2022-12-27 22:19:11 +03:00 committed by Vadim Glukhikh
parent 686926c0a9
commit 42e4ae96ae
2 changed files with 15 additions and 0 deletions

View File

@ -429,6 +429,8 @@ static Standard_Boolean ConicDefinition
term2 = -gdet/(cprim*pdet);
if (IsEllip) {
if (term1 <= eps || term2 <= eps)
return Standard_False;
Xax = cost;
Yax = sint;
Rmin = sqrt ( term1);
@ -439,12 +441,16 @@ static Standard_Boolean ConicDefinition
}
}
else if (term1 <= eps){
if (-term1 <= eps || term2 <= eps)
return Standard_False;
Xax = -sint;
Yax = cost;
Rmin = sqrt (-term1);
Rmax = sqrt (term2);
}
else {
if (term1 <= eps || -term2 <= eps)
return Standard_False;
Xax = cost;
Yax = sint;
Rmin = sqrt (-term2);

View File

@ -0,0 +1,9 @@
puts "==========================================================="
puts "0033304: Modeling Data - Floating point signal when converting a B-spline curve to analytical form"
puts "==========================================================="
puts "REQUIRED ALL: Conversion failed"
binrestore [locate_data_file bug33304_bspl_curv.bbrep] a
mkcurve c a
tocanon r c