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>
This commit is contained in:
Lars Knoll 2020-05-30 23:13:48 +02:00
parent 1d0384a385
commit c84e9c0700

View File

@ -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);