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/qpathclipper.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/qpathclipper.cpp')
-rw-r--r-- | src/gui/painting/qpathclipper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/painting/qpathclipper.cpp b/src/gui/painting/qpathclipper.cpp index 1a1b2d76e2..2fbf8bdcba 100644 --- a/src/gui/painting/qpathclipper.cpp +++ b/src/gui/painting/qpathclipper.cpp @@ -316,7 +316,7 @@ static inline qreal coordinate(const QPointF &pos, int axis) TreeNode SegmentTree::buildTree(int first, int last, int depth, const RectF &bounds) { if (depth >= 24 || (last - first) <= 10) { - TreeNode node; + TreeNode node = {}; node.leaf = true; node.index.interval.first = first; node.index.interval.last = last; |