aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2022-09-28 17:58:42 +0200
committerJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-10-01 17:17:39 +0200
commitc63fb86c01c5635a3e7f28c3b66de7cf908ef6d6 (patch)
tree4f7c59efe87c98a90b17b6194df7c82d1de13a83
parentcb0a6be983b7e4ee2784991273777579dcb90b9d (diff)
downloadqpdf-c63fb86c01c5635a3e7f28c3b66de7cf908ef6d6.tar.zst
Inline call to QPDFObjectHandle::parse in QPDF::readObject
-rw-r--r--include/qpdf/QPDFObjectHandle.hh2
-rw-r--r--libqpdf/QPDF.cc14
2 files changed, 7 insertions, 9 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh
index 6645f1ca..42488f95 100644
--- a/include/qpdf/QPDFObjectHandle.hh
+++ b/include/qpdf/QPDFObjectHandle.hh
@@ -455,7 +455,7 @@ class QPDFObjectHandle
// Construct an object as above by reading from the given
// InputSource at its current position and using the tokenizer you
// supply. Indirect objects and encrypted strings are permitted.
- // This method is intended to be called by QPDF for parsing
+ // This method was intended to be called by QPDF for parsing
// objects that are ready from the object's input stream.
QPDF_DLL
static QPDFObjectHandle parse(
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index 57e3f592..5cad3caf 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -22,6 +22,7 @@
#include <qpdf/QPDFExc.hh>
#include <qpdf/QPDFLogger.hh>
#include <qpdf/QPDFObject_private.hh>
+#include <qpdf/QPDFParser.hh>
#include <qpdf/QPDF_Array.hh>
#include <qpdf/QPDF_Dictionary.hh>
#include <qpdf/QPDF_Null.hh>
@@ -530,7 +531,7 @@ void
QPDF::inParse(bool v)
{
if (this->m->in_parse == v) {
- // This happens of QPDFObjectHandle::parseInternal tries to
+ // This happens if QPDFParser::parse tries to
// resolve an indirect object while it is parsing.
throw std::logic_error(
"QPDF: re-entrant parsing detected. This is a qpdf bug."
@@ -1413,13 +1414,10 @@ QPDF::readObject(
decrypter_ph = std::make_shared<StringDecrypter>(this, og);
decrypter = decrypter_ph.get();
}
- QPDFObjectHandle object = QPDFObjectHandle::parse(
- input,
- this->m->last_object_description,
- this->m->tokenizer,
- empty,
- decrypter,
- this);
+ auto object =
+ QPDFParser(
+ input, m->last_object_description, m->tokenizer, decrypter, this)
+ .parse(empty, false);
if (empty) {
// Nothing in the PDF spec appears to allow empty objects, but
// they have been encountered in actual PDF files and Adobe