summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qrawfont_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qrawfont_win.cpp')
-rw-r--r--src/gui/text/qrawfont_win.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qrawfont_win.cpp b/src/gui/text/qrawfont_win.cpp
index ea1e75b..a729e31 100644
--- a/src/gui/text/qrawfont_win.cpp
+++ b/src/gui/text/qrawfont_win.cpp
@@ -578,7 +578,9 @@ void QRawFontPrivate::platformLoadFromData(const QByteArray &fontData,
resolveGdi32();
if (ptrAddFontMemResourceEx && ptrRemoveFontMemResourceEx) {
DWORD count = 0;
- fontHandle = ptrAddFontMemResourceEx((void *)fontData.constData(), fontData.size(), 0, &count);
+ QByteArray newFontData = font.data();
+ fontHandle = ptrAddFontMemResourceEx((void *)newFontData.constData(), newFontData.size(),
+ 0, &count);
if (count == 0 && fontHandle != NULL) {
ptrRemoveFontMemResourceEx(fontHandle);
fontHandle = NULL;