mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0032314: Data Exchange - Reading corrupted STEP files crashes
RWAxis2Placement3d: fixed problem with reading parameters ( if sub-entity invalid, set has-parameter to false )
This commit is contained in:
parent
62eafa5ac7
commit
36fbf05b15
@ -50,26 +50,28 @@ void RWStepGeom_RWAxis2Placement3d::ReadStep
|
|||||||
// --- own field : axis ---
|
// --- own field : axis ---
|
||||||
|
|
||||||
Handle(StepGeom_Direction) aAxis;
|
Handle(StepGeom_Direction) aAxis;
|
||||||
Standard_Boolean hasAaxis = Standard_True;
|
Standard_Boolean hasAaxis = Standard_False;
|
||||||
if (data->IsParamDefined(num,3)) {
|
if (data->IsParamDefined(num,3))
|
||||||
|
{
|
||||||
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
|
//szv#4:S4163:12Mar99 `Standard_Boolean stat3 =` not needed
|
||||||
data->ReadEntity(num, 3,"axis", ach, STANDARD_TYPE(StepGeom_Direction), aAxis);
|
hasAaxis = data->ReadEntity(num, 3,"axis", ach, STANDARD_TYPE(StepGeom_Direction), aAxis);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
hasAaxis = Standard_False;
|
{
|
||||||
aAxis.Nullify();
|
aAxis.Nullify();
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- own field : refDirection ---
|
// --- own field : refDirection ---
|
||||||
|
|
||||||
Handle(StepGeom_Direction) aRefDirection;
|
Handle(StepGeom_Direction) aRefDirection;
|
||||||
Standard_Boolean hasArefDirection = Standard_True;
|
Standard_Boolean hasArefDirection = Standard_False;
|
||||||
if (data->IsParamDefined(num,4)) {
|
if (data->IsParamDefined(num,4))
|
||||||
|
{
|
||||||
//szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
|
//szv#4:S4163:12Mar99 `Standard_Boolean stat4 =` not needed
|
||||||
data->ReadEntity(num, 4,"ref_direction", ach, STANDARD_TYPE(StepGeom_Direction), aRefDirection);
|
hasArefDirection = data->ReadEntity(num, 4,"ref_direction", ach, STANDARD_TYPE(StepGeom_Direction), aRefDirection);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
hasArefDirection = Standard_False;
|
{
|
||||||
aRefDirection.Nullify();
|
aRefDirection.Nullify();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user