summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-02-10 15:24:55 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-11 20:59:15 +0100
commitdb98d65415b270f49e015154a37a39befc8c752e (patch)
treeb88d37a3139d663be32b42f771656bcb12d0a9b7 /src/plugins
parentae4243df1e53b0aaeada708f6fa7979a0f0d216a (diff)
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>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase.cpp2
-rw-r--r--src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
index 3bd24fdaab..2fa08d30ce 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp
@@ -841,7 +841,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
int type)
{
// 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;
static const int SMOOTH_SCALABLE = 0xffff;
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
index c9160e4a75..57a9077e5d 100644
--- a/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
+++ b/src/plugins/platforms/windows/qwindowsfontdatabase_ft.cpp
@@ -130,7 +130,7 @@ static bool addFontToDatabase(const QString &familyName, uchar charSet,
typedef QPair<QString, QStringList> FontKey;
// 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;
const int separatorPos = familyName.indexOf(QStringLiteral("::"));