From d8acccd5c8fff308a0010f787eedc594fa3e5ee9 Mon Sep 17 00:00:00 2001 From: m-holger Date: Sat, 12 Nov 2022 18:10:16 +0000 Subject: Warn if catalog type entry is invalid (fixes #810) --- include/qpdf/QPDF.hh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 13b66977..4541db64 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -910,8 +910,7 @@ class QPDF } }; - // The ParseGuard class allows QPDFObjectHandle to detect - // re-entrant parsing. + // The ParseGuard class allows QPDFParser to detect re-entrant parsing. class ParseGuard { friend class QPDFParser; @@ -933,7 +932,7 @@ class QPDF QPDF* qpdf; }; - // Pipe class is restricted to QPDF_Stream + // Pipe class is restricted to QPDF_Stream. class Pipe { friend class QPDF_Stream; @@ -961,6 +960,20 @@ class QPDF } }; + // JobSetter class is restricted to QPDFJob. + class JobSetter + { + friend class QPDFJob; + + private: + // Enable enhanced warnings for pdf file checking. + static void + setCheckMode(QPDF& qpdf, bool val) + { + qpdf.m->check_mode = val; + } + }; + // For testing only -- do not add to DLL static bool test_json_validators(); @@ -1698,6 +1711,7 @@ class QPDF bool ignore_xref_streams{false}; bool suppress_warnings{false}; bool attempt_recovery{true}; + bool check_mode{false}; std::shared_ptr encp; std::string pdf_version; std::map xref_table; -- cgit v1.2.3-54-g00ecf