mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0033603: Data Exchange, Step Import - Crash reading corrupted STEP file
Crash fixed by checking IsNull().
This commit is contained in:
parent
d1eae5b0d0
commit
3888b58c27
@ -1008,7 +1008,7 @@ Handle(Geom_BSplineSurface) StepToGeom::MakeBSplineSurface (const Handle(StepGeo
|
|||||||
Handle(Geom_CartesianPoint) StepToGeom::MakeCartesianPoint (const Handle(StepGeom_CartesianPoint)& SP,
|
Handle(Geom_CartesianPoint) StepToGeom::MakeCartesianPoint (const Handle(StepGeom_CartesianPoint)& SP,
|
||||||
const StepData_Factors& theLocalFactors)
|
const StepData_Factors& theLocalFactors)
|
||||||
{
|
{
|
||||||
if (SP->NbCoordinates() == 3)
|
if (!SP.IsNull() && SP->NbCoordinates() == 3)
|
||||||
{
|
{
|
||||||
const Standard_Real LF = theLocalFactors.LengthFactor();
|
const Standard_Real LF = theLocalFactors.LengthFactor();
|
||||||
const Standard_Real X = SP->CoordinatesValue(1) * LF;
|
const Standard_Real X = SP->CoordinatesValue(1) * LF;
|
||||||
|
@ -96,6 +96,11 @@ void StepToTopoDS_TranslateVertex::Init(const Handle(StepShape_Vertex)& aVertex,
|
|||||||
//:S4136 Standard_Real preci = BRepAPI::Precision();
|
//:S4136 Standard_Real preci = BRepAPI::Precision();
|
||||||
const Handle(StepShape_VertexPoint) VP = Handle(StepShape_VertexPoint)::DownCast(aVertex);
|
const Handle(StepShape_VertexPoint) VP = Handle(StepShape_VertexPoint)::DownCast(aVertex);
|
||||||
const Handle(StepGeom_Point) P = VP->VertexGeometry();
|
const Handle(StepGeom_Point) P = VP->VertexGeometry();
|
||||||
|
if (P.IsNull()) {
|
||||||
|
myError = StepToTopoDS_TranslateVertexOther;
|
||||||
|
done = Standard_False;
|
||||||
|
return;
|
||||||
|
}
|
||||||
const Handle(StepGeom_CartesianPoint) P1 = Handle(StepGeom_CartesianPoint)::DownCast(P);
|
const Handle(StepGeom_CartesianPoint) P1 = Handle(StepGeom_CartesianPoint)::DownCast(P);
|
||||||
Handle(Geom_CartesianPoint) P2 = StepToGeom::MakeCartesianPoint (P1, theLocalFactors);
|
Handle(Geom_CartesianPoint) P2 = StepToGeom::MakeCartesianPoint (P1, theLocalFactors);
|
||||||
BRep_Builder B;
|
BRep_Builder B;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user