]> OCCT Git - occt-copy.git/commitdiff
0029108: Crash writing STEP file
authorasuraven <asuraven@opencascade.com>
Mon, 2 Nov 2020 06:31:55 +0000 (09:31 +0300)
committerasuraven <asuraven@opencascade.com>
Mon, 2 Nov 2020 11:32:39 +0000 (14:32 +0300)
* Wrapped a try / catch block on creating objects in TopoDSToStep_MakeStepFace::Init()

src/TopoDSToStep/TopoDSToStep_MakeStepFace.cxx
tests/bugs/step/bug29108 [new file with mode: 0644]

index e83bf18860f837b593d4ed25d59c0f4cb5f4c43d..7cea157b53ca1619cfa3a35fd6ed7a4398aac94c 100644 (file)
@@ -180,6 +180,8 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
     return;
   }
   
+  try
+  {
   // -----------------
   // Translate Surface
   // -----------------
@@ -465,6 +467,13 @@ void TopoDSToStep_MakeStepFace::Init(const TopoDS_Face& aFace,
     myError = TopoDSToStep_NoWireMapped;
     done    = Standard_False;
   }
+  }
+  catch (Standard_Failure const& theFailure) 
+  {
+    FP->AddFail(errShape, theFailure.GetMessageString());
+    myError = TopoDSToStep_FaceOther;
+    done    = Standard_False;
+  }
 }
 
   
diff --git a/tests/bugs/step/bug29108 b/tests/bugs/step/bug29108
new file mode 100644 (file)
index 0000000..4dcc4aa
--- /dev/null
@@ -0,0 +1,15 @@
+puts "=========="
+puts "0029108: Data Exchange - Crash writing STEP file"
+puts "=========="
+puts ""
+
+restore [locate_data_file bug29108.brep] part
+stepwrite a part $imagedir/bug229108_temp.stp
+dall
+stepread ${imagedir}/bug229108_temp.stp a *
+
+tpcompound result
+checkprops result -s 11833
+checkshape result
+checknbshapes result -vertex 251 -edge 380 -wire 155 -face 141 -shell 3 -solid 2 -compsolid 0 -compound 4 -shape 936
+