summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-05-30 23:13:48 +0200
committerLars Knoll <lars.knoll@qt.io>2020-05-31 15:55:57 +0200
commitc84e9c0700639d2878b8c6caec3f661c4fc4c74d (patch)
tree6943a1056f598ec2959e314efb672e701b0f3573 /src/gui
parent1d0384a385090c1d4b4b2992f3880ee455a3dca7 (diff)
Fix a bogus assert
advances and glyphIndices can be nullptr's as long as numGlyphs is zero. Change-Id: I29c3764792c1a0ffaafd3393c82a26af65699ab3 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qrawfont.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qrawfont.cpp b/src/gui/text/qrawfont.cpp
index cc96c9262b..e4c8a0a919 100644
--- a/src/gui/text/qrawfont.cpp
+++ b/src/gui/text/qrawfont.cpp
@@ -608,9 +608,9 @@ bool QRawFont::glyphIndexesForChars(const QChar *chars, int numChars, quint32 *g
*/
bool QRawFont::advancesForGlyphIndexes(const quint32 *glyphIndexes, QPointF *advances, int numGlyphs, LayoutFlags layoutFlags) const
{
- Q_ASSERT(glyphIndexes && advances);
if (!d->isValid() || numGlyphs <= 0)
return false;
+ Q_ASSERT(glyphIndexes && advances);
QVarLengthArray<QFixed> tmpAdvances(numGlyphs);