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 #include #include +#include #include #include #include @@ -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(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