]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Avoid crashing in solver
authorazv <azv@opencascade.com>
Tue, 26 May 2015 15:16:35 +0000 (18:16 +0300)
committerazv <azv@opencascade.com>
Tue, 26 May 2015 15:16:53 +0000 (18:16 +0300)
src/SketchSolver/SketchSolver_Storage.cpp

index 63b22bf4cb4bf2360ae85b0afb4a213d0436c164..0e108b02d0325041ded73ab856205e9ac604686f 100644 (file)
@@ -554,7 +554,7 @@ int SketchSolver_Storage::deleteTemporaryConstraint()
   std::set<Slvs_hConstraint>::iterator aCIt = myTemporaryConstraints.begin();
   for (; aCIt != myTemporaryConstraints.end(); aCIt++) {
     int aPos = Search(*aCIt, myConstraints);
-    if (myConstraints[aPos].type != SLVS_C_WHERE_DRAGGED)
+    if (aPos >= (int)myConstraints.size() || myConstraints[aPos].type != SLVS_C_WHERE_DRAGGED)
       break;
     std::vector<Slvs_Constraint>::iterator anIt = myConstraints.begin();
     for (; anIt != myConstraints.end(); anIt++)