Mesh: Fix several coverity issues:
* CID 350557: Out-of-bounds read (false-positive) * CID 316517: Uninitialized scalar variable * CID 316519: Uninitialized scalar variable * CID 316547: Uninitialized scalar variable * CID 316556: Uninitialized scalar variable * CID 350614: Uncaught exception * CID 350606: Uncaught exception * CID 332681: Using invalid iterator
This commit is contained in:
@@ -111,7 +111,8 @@ int Exporter::addObject(App::DocumentObject *obj, float tol)
|
||||
it = meshCache.emplace(linked,
|
||||
static_cast<Mesh::Feature*>(linked)->Mesh.getValue()).first;
|
||||
it->second.setTransform(Base::Matrix4D());
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
Base::PyGILStateLocker lock;
|
||||
PyObject *pyobj = nullptr;
|
||||
linked->getSubObject("", &pyobj, nullptr, false);
|
||||
@@ -128,10 +129,14 @@ int Exporter::addObject(App::DocumentObject *obj, float tol)
|
||||
Py_DECREF(pyobj);
|
||||
}
|
||||
}
|
||||
MeshObject mesh(it->second);
|
||||
mesh.transformGeometry(matrix);
|
||||
if (addMesh(sobj->Label.getValue(), mesh))
|
||||
++count;
|
||||
|
||||
// Add a new mesh
|
||||
if (it != meshCache.end()) {
|
||||
MeshObject mesh(it->second);
|
||||
mesh.transformGeometry(matrix);
|
||||
if (addMesh(sobj->Label.getValue(), mesh))
|
||||
++count;
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user