mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-21 10:13:43 +03:00
0024759: Crash on STEP import, when reading a file exported in non-"C" locale
Fix for step reading Add test case bugs/xde/bug24759
This commit is contained in:
parent
ca0c0b11ac
commit
4fc7830275
@ -52,8 +52,8 @@ void RWStepGeom_RWCartesianPoint::ReadStep
|
|||||||
if(nb2 > 3) {
|
if(nb2 > 3) {
|
||||||
ach->AddWarning("More than 3 coordinates, ignored");
|
ach->AddWarning("More than 3 coordinates, ignored");
|
||||||
}
|
}
|
||||||
nbcoord = nb2;
|
nbcoord = Min (nb2, 3);
|
||||||
for (Standard_Integer i2 = 0; i2 < nb2; i2 ++) {
|
for (Standard_Integer i2 = 0; i2 < nbcoord; i2 ++) {
|
||||||
if (data->ReadReal (nsub2,i2+1,"coordinates",ach,aCoordinatesItem)) {
|
if (data->ReadReal (nsub2,i2+1,"coordinates",ach,aCoordinatesItem)) {
|
||||||
XYZ[i2] = aCoordinatesItem;
|
XYZ[i2] = aCoordinatesItem;
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ void RWStepGeom_RWCartesianPoint::ReadStep
|
|||||||
|
|
||||||
|
|
||||||
// ent->Init(aName, aCoordinates);
|
// ent->Init(aName, aCoordinates);
|
||||||
if (nbcoord >= 3) ent->Init3D (aName, XYZ[0],XYZ[1],XYZ[2]);
|
if (nbcoord == 3) ent->Init3D (aName, XYZ[0],XYZ[1],XYZ[2]);
|
||||||
else ent->Init2D (aName, XYZ[0],XYZ[1]);
|
else ent->Init2D (aName, XYZ[0],XYZ[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
tests/bugs/xde/bug24759
Normal file
13
tests/bugs/xde/bug24759
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
puts "================"
|
||||||
|
puts "OCC24759"
|
||||||
|
puts "================"
|
||||||
|
puts ""
|
||||||
|
##########################################################################
|
||||||
|
# Crash on STEP import, when reading a file exported is non-"C" locale
|
||||||
|
##########################################################################
|
||||||
|
|
||||||
|
decho off
|
||||||
|
stepread [locate_data_file bug24759_FissionMeter.step] aaa f *
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user