mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0033414: Modeling Algorithms - Access violation during executing BRepAlgoAPI_Section::Build()
Crush occurred due to the fields IntTools_SurfaceRangeLocalizeData::myUParams, IntTools_SurfaceRangeLocalizeData::myVParams and IntTools_SurfaceRangeLocalizeData::myGridPoints not being checked for NULL in some cases. Missing checks are added.
This commit is contained in:
parent
b47b7e69f7
commit
afccc8d019
@ -224,7 +224,7 @@ const gp_Pnt &IntTools_SurfaceRangeLocalizeData::GetPointInFrame
|
||||
Standard_Integer aFrmUInd = theUIndex + myUIndMin - 1;
|
||||
Standard_Integer aFrmVInd = theVIndex + myVIndMin - 1;
|
||||
|
||||
if (aFrmUInd > myUIndMax || aFrmVInd > myVIndMax)
|
||||
if (myGridPoints.IsNull() || aFrmUInd > myUIndMax || aFrmVInd > myVIndMax)
|
||||
return gp::Origin();
|
||||
|
||||
return myGridPoints->Value(aFrmUInd, aFrmVInd);
|
||||
@ -235,7 +235,7 @@ Standard_Real IntTools_SurfaceRangeLocalizeData::GetUParamInFrame
|
||||
{
|
||||
Standard_Integer aFrmInd = theIndex + myUIndMin - 1;
|
||||
|
||||
if (aFrmInd > myUIndMax)
|
||||
if (myUParams.IsNull() || aFrmInd > myUIndMax)
|
||||
return Precision::Infinite();
|
||||
|
||||
return myUParams->Value(aFrmInd);
|
||||
@ -246,7 +246,7 @@ Standard_Real IntTools_SurfaceRangeLocalizeData::GetVParamInFrame
|
||||
{
|
||||
Standard_Integer aFrmInd = theIndex + myVIndMin - 1;
|
||||
|
||||
if (aFrmInd > myVIndMax)
|
||||
if (myVParams.IsNull() || aFrmInd > myVIndMax)
|
||||
return Precision::Infinite();
|
||||
|
||||
return myVParams->Value(aFrmInd);
|
||||
|
10
tests/bugs/modalg_8/bug33414
Normal file
10
tests/bugs/modalg_8/bug33414
Normal file
@ -0,0 +1,10 @@
|
||||
puts "========================"
|
||||
puts "0033414: Modeling Algorithms - Access violation during executing BRepAlgoAPI_Section::Build()"
|
||||
puts "========================"
|
||||
|
||||
set filepath1 [locate_data_file "CR33414_1.brep"]
|
||||
set filepath2 [locate_data_file "CR33414_2.brep"]
|
||||
restore ${filepath1} shape1
|
||||
restore ${filepath2} shape2
|
||||
bsection res shape1 shape2
|
||||
# If bsection didn't cause a crash - everything is OK.
|
Loading…
x
Reference in New Issue
Block a user