aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDF.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index 89d4a0a8..8cff3dfd 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -709,10 +709,11 @@ QPDF::read_xref(qpdf_offset_t xref_offset)
// Make sure we keep only the highest generation for any object.
QPDFObjGen last_og{-1, 0};
- for (auto const& og: m->xref_table) {
- if (og.first.getObj() == last_og.getObj())
+ for (auto const& item: m->xref_table) {
+ auto id = item.first.getObj();
+ if (id == last_og.getObj() && id > 0)
removeObject(last_og);
- last_og = og.first;
+ last_og = item.first;
}
}
@@ -2405,7 +2406,7 @@ QPDF::getCompressibleObjGens()
while (!queue.empty()) {
auto obj = queue.back();
queue.pop_back();
- if (obj.isIndirect()) {
+ if (obj.getObjectID() > 0) {
QPDFObjGen og = obj.getObjGen();
const size_t id = toS(og.getObj() - 1);
if (id >= max_obj)