summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2021-03-29 17:30:46 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2021-04-19 15:18:46 +0200
commit673d9c34f4523d030282663c54c30bcc1fe3c6fa (patch)
tree6d996c7d3d56275d4f9bf8d627bcb124eaa52a01 /src/gui
parent6c3599460ca9a7eaba728adbb4b7ab3d519f3ffb (diff)
Assert that engine isn't nullptr before dereferencing
The engine pointer is guaranteed to be initialized in line 1838, so we can assert that the correct value is passed into the function to fix static analyzer warning 1d9b8ce922ee0891fb0d477dc17fdb8d. Change-Id: I773bbaa579afec0d7a79d4393ee66fd26ba9629b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qtextlayout.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp
index 381c1d20ce..cb17006c29 100644
--- a/src/gui/text/qtextlayout.cpp
+++ b/src/gui/text/qtextlayout.cpp
@@ -1679,6 +1679,7 @@ namespace {
inline void calculateRightBearing(QFontEngine *engine, glyph_t glyph)
{
+ Q_ASSERT(engine);
qreal rb;
engine->getGlyphBearings(glyph, nullptr, &rb);