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
Pick-to: 6.0
Change-Id: If9255a5a3124038356bc5053810f98c7c88f8a01
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Christian Ehrlicher 2021-01-08 20:43:21 +01:00
parent d26da5fc09
commit 05706bd2b0

View File

@ -1127,7 +1127,7 @@ static QByteArray bindFont(const QList<QTtfTable>& _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();