1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +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:
gka 2013-11-28 11:19:34 +04:00 committed by bugmaster
parent 566f84411f
commit 5cc18856ae
2 changed files with 13 additions and 0 deletions

View File

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

10
tests/bugs/step/bug24383 Executable file
View File

@ -0,0 +1,10 @@
puts "============"
puts "OCC24383"
puts "============"
puts ""
#######################################################################
# Access violation during STEP file import
#######################################################################
ReadStep D [locate_data_file bug24383_224013.stp]