mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-24 13:50:49 +03:00
0030616: Crash on reading STEP file
Added protections to avoid exceptions for null objects. For reading entity StepShape_ToleranceValue was added reading lower and upper bounds represented by entities "StepRepr_ReprItemAndMeasureWithUnit" or "StepRepr_MeasureRepresentationItem"
This commit is contained in:
@@ -21,21 +21,21 @@ IMPLEMENT_STANDARD_RTTIEXT(StepShape_ToleranceValue,Standard_Transient)
|
||||
StepShape_ToleranceValue::StepShape_ToleranceValue () { }
|
||||
|
||||
void StepShape_ToleranceValue::Init
|
||||
(const Handle(StepBasic_MeasureWithUnit)& lower_bound,
|
||||
const Handle(StepBasic_MeasureWithUnit)& upper_bound)
|
||||
(const Handle(Standard_Transient)& lower_bound,
|
||||
const Handle(Standard_Transient)& upper_bound)
|
||||
{
|
||||
theLowerBound = lower_bound;
|
||||
theUpperBound = upper_bound;
|
||||
}
|
||||
|
||||
Handle(StepBasic_MeasureWithUnit) StepShape_ToleranceValue::LowerBound () const
|
||||
Handle(Standard_Transient) StepShape_ToleranceValue::LowerBound () const
|
||||
{ return theLowerBound; }
|
||||
|
||||
void StepShape_ToleranceValue::SetLowerBound (const Handle(StepBasic_MeasureWithUnit)& lower_bound)
|
||||
void StepShape_ToleranceValue::SetLowerBound (const Handle(Standard_Transient)& lower_bound)
|
||||
{ theLowerBound = lower_bound; }
|
||||
|
||||
Handle(StepBasic_MeasureWithUnit) StepShape_ToleranceValue::UpperBound () const
|
||||
Handle(Standard_Transient) StepShape_ToleranceValue::UpperBound () const
|
||||
{ return theUpperBound; }
|
||||
|
||||
void StepShape_ToleranceValue::SetUpperBound (const Handle(StepBasic_MeasureWithUnit)& upper_bound)
|
||||
void StepShape_ToleranceValue::SetUpperBound (const Handle(Standard_Transient)& upper_bound)
|
||||
{ theUpperBound = upper_bound; }
|
||||
|
@@ -35,15 +35,15 @@ public:
|
||||
|
||||
Standard_EXPORT StepShape_ToleranceValue();
|
||||
|
||||
Standard_EXPORT void Init (const Handle(StepBasic_MeasureWithUnit)& lower_bound, const Handle(StepBasic_MeasureWithUnit)& upper_bound);
|
||||
Standard_EXPORT void Init (const Handle(Standard_Transient)& lower_bound, const Handle(Standard_Transient)& upper_bound);
|
||||
|
||||
Standard_EXPORT Handle(StepBasic_MeasureWithUnit) LowerBound() const;
|
||||
Standard_EXPORT Handle(Standard_Transient) LowerBound() const;
|
||||
|
||||
Standard_EXPORT void SetLowerBound (const Handle(StepBasic_MeasureWithUnit)& lower_bound);
|
||||
Standard_EXPORT void SetLowerBound (const Handle(Standard_Transient)& lower_bound);
|
||||
|
||||
Standard_EXPORT Handle(StepBasic_MeasureWithUnit) UpperBound() const;
|
||||
Standard_EXPORT Handle(Standard_Transient) UpperBound() const;
|
||||
|
||||
Standard_EXPORT void SetUpperBound (const Handle(StepBasic_MeasureWithUnit)& upper_bound);
|
||||
Standard_EXPORT void SetUpperBound (const Handle(Standard_Transient)& upper_bound);
|
||||
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ protected:
|
||||
private:
|
||||
|
||||
|
||||
Handle(StepBasic_MeasureWithUnit) theLowerBound;
|
||||
Handle(StepBasic_MeasureWithUnit) theUpperBound;
|
||||
Handle(Standard_Transient) theLowerBound;
|
||||
Handle(Standard_Transient) theUpperBound;
|
||||
|
||||
|
||||
};
|
||||
|
Reference in New Issue
Block a user