aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2024-02-04 22:11:53 +0100
committerJay Berkenbilt <ejb@ql.org>2024-02-04 22:12:01 +0100
commit7caa9ddf5a8b272c94fa5d4c079f2be8eabff983 (patch)
tree64451d1714bb5625cc45cbcbef96175756fee457 /libqpdf/QPDF.cc
parent532cc58d7e1ad73d2e724abb0bb21af90e791d30 (diff)
downloadqpdf-7caa9ddf5a8b272c94fa5d4c079f2be8eabff983.tar.zst
Format code
Diffstat (limited to 'libqpdf/QPDF.cc')
-rw-r--r--libqpdf/QPDF.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index 01158ce2..fdd75359 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -711,8 +711,9 @@ QPDF::read_xref(qpdf_offset_t xref_offset)
QPDFObjGen last_og{-1, 0};
for (auto const& item: m->xref_table) {
auto id = item.first.getObj();
- if (id == last_og.getObj() && id > 0)
+ if (id == last_og.getObj() && id > 0) {
removeObject(last_og);
+ }
last_og = item.first;
}
}
@@ -2413,9 +2414,10 @@ QPDF::getCompressibleObjGens()
if (obj.getObjectID() > 0) {
QPDFObjGen og = obj.getObjGen();
const size_t id = toS(og.getObj() - 1);
- if (id >= max_obj)
+ if (id >= max_obj) {
throw std::logic_error(
"unexpected object id encountered in getCompressibleObjGens");
+ }
if (visited[id]) {
QTC::TC("qpdf", "QPDF loop detected traversing objects");
continue;