mirror of
https://github.com/qpdf/qpdf.git
synced 2025-01-02 22:50:20 +00:00
Fix calculation of xref stream stream columns
Fix problem: if the last object in the first part of a linearized file had an offset that was below 65536 by less than the size of the hint stream, the xref stream was invalid and the resulting file is not usable.
This commit is contained in:
parent
247d70efee
commit
b0a96ce6aa
@ -1,3 +1,10 @@
|
||||
2014-02-22 Jay Berkenbilt <ejb@ql.org>
|
||||
|
||||
* Bug fix: if the last object in the first part of a linearized
|
||||
file had an offset that was below 65536 by less than the size of
|
||||
the hint stream, the xref stream was invalid and the resulting file
|
||||
is not usable. This is now fixed.
|
||||
|
||||
2014-01-14 Jay Berkenbilt <ejb@ql.org>
|
||||
|
||||
* 5.1.1: release
|
||||
|
@ -2447,7 +2447,7 @@ QPDFWriter::writeXRefStream(int xref_id, int max_id, qpdf_offset_t max_offset,
|
||||
qpdf_offset_t space_before_zero = xref_offset - 1;
|
||||
|
||||
// field 1 contains offsets and object stream identifiers
|
||||
int f1_size = std::max(bytesNeeded(max_offset),
|
||||
int f1_size = std::max(bytesNeeded(max_offset + hint_length),
|
||||
bytesNeeded(max_id));
|
||||
|
||||
// field 2 contains object stream indices
|
||||
|
Loading…
Reference in New Issue
Block a user