diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-05-11 13:53:32 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-05-12 05:57:03 +0200 |
commit | b7b17e719ea57f2d697bc0f61bffaa0fab910701 (patch) | |
tree | d143727923100455517eef10fa6769d3c13e7aa1 /src/gui/painting/qtriangulator.cpp | |
parent | 902120c62146e06db953a30cb876ecc7a5be3e28 (diff) |
Fix coverity warnings about uninitialized data members
Coverity alerts about uninitialized members. While this might be ok
in the code here (ie TreeNode::splitLeft is never used for leaf nodes)
it can easily result in undefined behavior and other hard-to-debug
issues.
Initializing the struct with initializer syntax; compiler explorer
indicates that the compile will be able to optimze the calls to avoid
duplicate initialization of data members.
Change-Id: I0eb5d26e34f466d8c659c1945f02601aef511fbf
Fixes: QTBUG-84160
Fixes: QTBUG-84156
Coverity-Id: 218601
Coverity-Id: 11398
Pick-to: 5.15
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/gui/painting/qtriangulator.cpp')
-rw-r--r-- | src/gui/painting/qtriangulator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qtriangulator.cpp b/src/gui/painting/qtriangulator.cpp index ec3ab8ff8f..eab06d4d4c 100644 --- a/src/gui/painting/qtriangulator.cpp +++ b/src/gui/painting/qtriangulator.cpp @@ -1985,7 +1985,7 @@ void QTriangulator<T>::SimpleToMonotone::createDiagonal(int lower, int upper) int prevLower = m_edges.at(lower).previous; int prevUpper = m_edges.at(upper).previous; - Edge e; + Edge e = {}; e.twin = m_edges.size() + 1; e.next = upper; |