1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0030628: [REGRESSION] Data Exchange - Crash on importing STEP file

RWHeaderSection_RWFileDescription::ReadStep(), added check for an empty list.
This commit is contained in:
kgv 2019-07-11 09:38:54 +03:00 committed by bugmaster
parent b8d92a7f8f
commit 2fb08f0132
2 changed files with 21 additions and 7 deletions

View File

@ -37,15 +37,17 @@ void RWHeaderSection_RWFileDescription::ReadStep
Handle(Interface_HArray1OfHAsciiString) aDescription;
Handle(TCollection_HAsciiString) aDescriptionItem;
Standard_Integer nsub1;
nsub1 = data->SubListNumber(num, 1, Standard_False);
Standard_Integer nsub1 = data->SubListNumber(num, 1, Standard_False);
if (nsub1 !=0) {
Standard_Integer nb1 = data->NbParams(nsub1);
aDescription = new Interface_HArray1OfHAsciiString (1, nb1);
for (Standard_Integer i1 = 1; i1 <= nb1; i1 ++) {
Standard_Boolean stat1 = data->ReadString
(nsub1,i1,"description",ach,aDescriptionItem);
if (stat1) aDescription->SetValue(i1,aDescriptionItem);
if (nb1 > 0)
{
aDescription = new Interface_HArray1OfHAsciiString (1, nb1);
for (Standard_Integer i1 = 1; i1 <= nb1; i1 ++) {
Standard_Boolean stat1 = data->ReadString
(nsub1,i1,"description",ach,aDescriptionItem);
if (stat1) aDescription->SetValue(i1,aDescriptionItem);
}
}
}
else {

12
tests/bugs/step/bug30628 Normal file
View File

@ -0,0 +1,12 @@
puts "# ====================================================================="
puts "# 0030628: Data Exchange - Crash on importing STEP file"
puts "# ====================================================================="
puts ""
vclear
vinit View1
vaxo
ReadStep D [locate_data_file bug30628_319892-GSE306L520-HOG-s5.stp]
XDisplay D -dispMode 1
vfit
vdump ${imagedir}/${casename}.png