Skip to content

Commit

Permalink
QPdfWriter: fix embedding fonts in pdf files
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
chehrlic committed Jan 9, 2021
1 parent d26da5f commit 05706bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/gui/text/qfontsubset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 05706bd

Please sign in to comment.