Sketcher: Coverity 332695 - unlikely array indexing with negative value

This commit is contained in:
Abdullah Tahiri
2022-03-12 20:07:44 +01:00
parent 4185b8b849
commit a5d0de0994

View File

@@ -3478,9 +3478,12 @@ bool Sketch::updateGeometry()
// Now we update the position of the points in the solver, so that any call to solve()
// calculates constraints and positions based on the actual position of the knots.
auto pointindex = getPointId(*it5, PointPos::start);
auto solverpoint = Points[pointindex];
*(solverpoint.x) = pointcoords.x;
*(solverpoint.y) = pointcoords.y;
if(pointindex >= 0) {
auto solverpoint = Points[pointindex];
*(solverpoint.x) = pointcoords.x;
*(solverpoint.y) = pointcoords.y;
}
}
}
}