FEM: Make sure that points and normals array have equal size as otherwise a crash may occur

This commit is contained in:
wmayer
2024-04-26 21:44:08 +02:00
committed by wwmayer
parent 4d2e124f11
commit 93c1040d25

View File

@@ -228,6 +228,10 @@ void ViewProviderFemConstraint::updateSymbol()
auto obj = static_cast<const Fem::Constraint*>(this->getObject());
const std::vector<Base::Vector3d>& points = obj->Points.getValue();
const std::vector<Base::Vector3d>& normals = obj->Normals.getValue();
if (points.size() != normals.size()) {
return;
}
pMultCopy->matrix.setNum(points.size());
SbMatrix* mat = pMultCopy->matrix.startEditing();