mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024383: Access violation during STEP file import
Protection for null magnitude of vector written in file was added. Test cases for issue CR24383
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <gp_Vec.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Precision.hxx>
|
||||
|
||||
//=============================================================================
|
||||
// Creation d' une Line de Geom a partir d' une Line de Step
|
||||
@@ -46,6 +47,8 @@ Standard_Boolean StepToGeom_MakeLine::Convert (const Handle(StepGeom_Line)& SC,
|
||||
Handle(Geom_VectorWithMagnitude) D;
|
||||
if (StepToGeom_MakeVectorWithMagnitude::Convert(SC->Dir(),D))
|
||||
{
|
||||
if( D->Vec().SquareMagnitude() < Precision::Confusion() * Precision::Confusion())
|
||||
return Standard_False;
|
||||
const gp_Dir V(D->Vec());
|
||||
CC = new Geom_Line(P->Pnt(), V);
|
||||
return Standard_True;
|
||||
|
Reference in New Issue
Block a user