aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-09-13 17:21:29 +0200
committerJay Berkenbilt <ejb@ql.org>2022-09-13 17:21:29 +0200
commit2394acf7a688b2d080d4233d66a6e22bf46f0fca (patch)
tree72f7d8587d690e3a6a47a04ce97dc656f53495a0 /libqpdf
parenta0b1a181725721fe330c9b9abc6c16f93d28ac4d (diff)
downloadqpdf-2394acf7a688b2d080d4233d66a6e22bf46f0fca.tar.zst
Remove explicit direct object check from getObject
An indirect object reference to 0, 0 is invalid. If it appears in the file or is parsed from a string, the parser catches it. This check would only be useful for someone explicitly calling getObject with 0, 0, and that would trigger an error during resolve().
Diffstat (limited to 'libqpdf')
-rw-r--r--libqpdf/QPDF.cc6
1 files changed, 1 insertions, 5 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index 8a6831f9..f952aaee 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -1781,9 +1781,8 @@ QPDF::readObjectAtOffset(
// not triggered by an xref lookup.
check_og = false;
try_recovery = false;
- } else {
- setLastObjectDescription(description, exp_og);
}
+ setLastObjectDescription(description, exp_og);
if (!this->m->attempt_recovery) {
try_recovery = false;
@@ -2190,9 +2189,6 @@ QPDF::reserveStream(QPDFObjGen const& og)
QPDFObjectHandle
QPDF::getObject(QPDFObjGen const& og)
{
- if (!og.isIndirect()) {
- return QPDFObjectHandle::newNull();
- }
if (!isCached(og)) {
m->obj_cache[og] = ObjCache(QPDF_Unresolved::create(this, og), -1, -1);
}