diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-04-19 13:04:41 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-04-19 15:20:45 +0200 |
commit | bf7ca623a65f25cc4ac7a3ca0d6635331ec07c25 (patch) | |
tree | 40f6fa11f7dd41fd51343af01e1e298a2f7fd859 /servers/physics | |
parent | 394e6d5ee1479d402892d6df75dddceeb967efcc (diff) |
Fix Coverity reports of uninitialized scalar variable
Fixes most current reports on Coverity Scan of uninitialized scalar
variable (CWE-457): https://cwe.mitre.org/data/definitions/457.html
These happen most of the time (in our code) when instanciating structs
without a constructor (or with an incomplete one), and later returning
the instance. This is sometimes intended though, as some parameters are
only used in some situations and should not be double-initialized for
performance reasons (e.g. `constant` in ShaderLanguage::Token).
Diffstat (limited to 'servers/physics')
-rw-r--r-- | servers/physics/body_pair_sw.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/servers/physics/body_pair_sw.cpp b/servers/physics/body_pair_sw.cpp index 882d201f61..2a6a9e08ae 100644 --- a/servers/physics/body_pair_sw.cpp +++ b/servers/physics/body_pair_sw.cpp @@ -78,6 +78,7 @@ void BodyPairSW::contact_added_callback(const Vector3 &p_point_A, const Vector3 contact.local_A = local_A; contact.local_B = local_B; contact.normal = (p_point_A - p_point_B).normalized(); + contact.mass_normal = 0; // will be computed in setup() // attempt to determine if the contact will be reused real_t contact_recycle_radius = space->get_contact_recycle_radius(); |