From 38159913b88dd894d22c4522df23035a7965e58d Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 8 Jan 2021 20:43:21 +0100 Subject: [PATCH] QPdfWriter: fix embedding fonts in pdf files The container size change from int32_t to int64_t created a subtle error during font serialization. The size of a QByteArray was serialized without a proper cast and therefore now 8 bytes instead 4 bytes were written to the stream. Fixes: QTBUG-89727 Change-Id: If9255a5a3124038356bc5053810f98c7c88f8a01 Reviewed-by: Shawn Rutledge (cherry picked from commit 05706bd2b005dd159be34107cc43c92e7f12eb35) Reviewed-by: Qt Cherry-pick Bot --- src/gui/text/qfontsubset.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp index 2351cad0725..b5cf29a8b7b 100644 --- a/src/gui/text/qfontsubset.cpp +++ b/src/gui/text/qfontsubset.cpp @@ -1127,7 +1127,7 @@ static QByteArray bindFont(const QList& _tables) f << t.tag << checksum(t.data) << table_offset - << t.data.size(); + << quint32(t.data.size()); table_offset += size; #define TAG(x) char(t.tag >> 24) << char((t.tag >> 16) & 0xff) << char((t.tag >> 8) & 0xff) << char(t.tag & 0xff) //qDebug() << "table " << TAG(t.tag) << "has size " << t.data.size() << "stream at " << f.offset();