aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-06-21 23:37:33 +0200
committerJay Berkenbilt <ejb@ql.org>2019-06-21 23:56:24 +0200
commitb07ad6794eea175ee7f4b8c505995bdb4f397ce6 (patch)
tree43ca23b83e514e7f1f2c362cfc1b6ca21c21593e /libqpdf/QPDFObjectHandle.cc
parenta35d4ce9ccb3eb5903df3d221fdfd9a0d1fb5c37 (diff)
downloadqpdf-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.cc6
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)
{