1
0
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:
dkulikov 2023-06-22 16:54:21 +01:00 committed by jokwajeb
parent b47b7e69f7
commit afccc8d019
2 changed files with 13 additions and 3 deletions

View File

@ -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);

View 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.