Windows: Fix potential crash in font database when family name is empty.
Task-number: QTBUG-36651 Change-Id: Icd3edc7dbed3e692b32374b0ab6251e7f939589d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
parent
ae4243df1e
commit
db98d65415
@ -841,7 +841,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
|
|||||||
int type)
|
int type)
|
||||||
{
|
{
|
||||||
// the "@family" fonts are just the same as "family". Ignore them.
|
// the "@family" fonts are just the same as "family". Ignore them.
|
||||||
if (familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QStringLiteral("WST_")))
|
if (familyName.isEmpty() || familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QStringLiteral("WST_")))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
static const int SMOOTH_SCALABLE = 0xffff;
|
static const int SMOOTH_SCALABLE = 0xffff;
|
||||||
|
@ -130,7 +130,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
|
|||||||
typedef QPair<QString, QStringList> FontKey;
|
typedef QPair<QString, QStringList> FontKey;
|
||||||
|
|
||||||
// the "@family" fonts are just the same as "family". Ignore them.
|
// the "@family" fonts are just the same as "family". Ignore them.
|
||||||
if (familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QStringLiteral("WST_")))
|
if (familyName.isEmpty() || familyName.at(0) == QLatin1Char('@') || familyName.startsWith(QStringLiteral("WST_")))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const int separatorPos = familyName.indexOf(QStringLiteral("::"));
|
const int separatorPos = familyName.indexOf(QStringLiteral("::"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user