mirror of
https://github.com/qpdf/qpdf.git
synced 2024-11-08 14:21:06 +00:00
In QPDF::resolveObjectsInStream avoid creating xref table entries
Invalid entries are created when objects in the stream do not have an existing xref entry.
This commit is contained in:
parent
6d640c569a
commit
a367e56afc
@ -1952,8 +1952,9 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
|
|||||||
m->last_object_description += "object ";
|
m->last_object_description += "object ";
|
||||||
for (auto const& iter: offsets) {
|
for (auto const& iter: offsets) {
|
||||||
QPDFObjGen og(iter.first, 0);
|
QPDFObjGen og(iter.first, 0);
|
||||||
QPDFXRefEntry const& entry = m->xref_table[og];
|
auto entry = m->xref_table.find(og);
|
||||||
if ((entry.getType() == 2) && (entry.getObjStreamNumber() == obj_stream_number)) {
|
if (entry != m->xref_table.end() && entry->second.getType() == 2 &&
|
||||||
|
entry->second.getObjStreamNumber() == obj_stream_number) {
|
||||||
int offset = iter.second;
|
int offset = iter.second;
|
||||||
input->seek(offset, SEEK_SET);
|
input->seek(offset, SEEK_SET);
|
||||||
QPDFObjectHandle oh = readObjectInStream(input, iter.first);
|
QPDFObjectHandle oh = readObjectInStream(input, iter.first);
|
||||||
|
Loading…
Reference in New Issue
Block a user