From ead6cc40df7d6cede49c58bc9ce3c461a068afce Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Sun, 2 Mar 2014 02:04:39 +0200 Subject: Fix retreiving the 'head' table in QPAGenerator The 'head' table is usually of 54 bytes length. Passing the buffer of 4 bytes capacity for the 'head' table is expected to return false, thus skipping the FontRevision tag in QPAGenerator::writeHeader(). Change-Id: I02c0b13f3cbf13579a845fe78fcbc8a437ae22bf Reviewed-by: Lars Knoll --- src/gui/text/qfontengine_qpa.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/gui/text/qfontengine_qpa.cpp b/src/gui/text/qfontengine_qpa.cpp index cb40a5388a..eb6a97c5f1 100644 --- a/src/gui/text/qfontengine_qpa.cpp +++ b/src/gui/text/qfontengine_qpa.cpp @@ -563,11 +563,9 @@ void QPAGenerator::writeHeader() writeTaggedUInt32(QFontEngineQPA::Tag_FileIndex, face.index); { - uchar data[4]; - uint len = 4; - bool ok = fe->getSfntTableData(MAKE_TAG('h', 'e', 'a', 'd'), data, &len); - if (ok) { - const quint32 revision = qFromBigEndian(data); + const QByteArray head = fe->getSfntTable(MAKE_TAG('h', 'e', 'a', 'd')); + if (head.size() >= 4) { + const quint32 revision = qFromBigEndian(reinterpret_cast(head.constData())); writeTaggedUInt32(QFontEngineQPA::Tag_FontRevision, revision); } } -- cgit v1.2.3