From 673d9c34f4523d030282663c54c30bcc1fe3c6fa Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 29 Mar 2021 17:30:46 +0200 Subject: 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 Reviewed-by: Jonas Karlsson Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextlayout.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/gui/text') 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); -- cgit v1.2.3