diff options
author | Jay Berkenbilt <ejb@ql.org> | 2019-06-21 23:37:33 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2019-06-21 23:56:24 +0200 |
commit | b07ad6794eea175ee7f4b8c505995bdb4f397ce6 (patch) | |
tree | 43ca23b83e514e7f1f2c362cfc1b6ca21c21593e /libqpdf/QPDFObjectHandle.cc | |
parent | a35d4ce9ccb3eb5903df3d221fdfd9a0d1fb5c37 (diff) | |
download | qpdf-b07ad6794eea175ee7f4b8c505995bdb4f397ce6.tar.zst |
Fix bugs found by fuzz tests
* Several assertions in linearization were not always true; change
them to run time errors
* Handle a few cases of uninitialized objects
* Handle pages with no contents when doing form operations
* Handle invalid page tree nodes when traversing pages
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 9ccfa37a..a3147940 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -1407,6 +1407,12 @@ QPDFObjectHandle::coalesceContentStreams() QTC::TC("qpdf", "QPDFObjectHandle coalesce called on stream"); return; } + else if (! contents.isArray()) + { + // /Contents is optional for pages, and some very damaged + // files may have pages that are invalid in other ways. + return; + } QPDF* qpdf = getOwningQPDF(); if (qpdf == 0) { |