aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2020-11-11 15:50:43 +0100
committerJay Berkenbilt <ejb@ql.org>2020-11-11 15:50:43 +0100
commitbd79138c841c0076f7f45ae9a530f480aeec2633 (patch)
tree191f8bb3683df8f60bd050e50f0cc88c046e6785 /libqpdf/QPDFObjectHandle.cc
parenta7ef572c8485636aeb988f9c912979401c1e2164 (diff)
downloadqpdf-bd79138c841c0076f7f45ae9a530f480aeec2633.tar.zst
Treat direct page as runtime rather than logic error (fuzz issue 27393)
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r--libqpdf/QPDFObjectHandle.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc
index 472ff4e8..90e1d2d2 100644
--- a/libqpdf/QPDFObjectHandle.cc
+++ b/libqpdf/QPDFObjectHandle.cc
@@ -1512,9 +1512,11 @@ QPDFObjectHandle::coalesceContentStreams()
{
// Should not be possible for a page object to not have an
// owning PDF unless it was manually constructed in some
- // incorrect way.
- throw std::logic_error("coalesceContentStreams called on object"
- " with no associated PDF file");
+ // incorrect way. However, it can happen in a PDF file whose
+ // page structure is direct, which is against spec but still
+ // possible to hand construct, as in fuzz issue 27393.
+ throw std::runtime_error("coalesceContentStreams called on object"
+ " with no associated PDF file");
}
QPDFObjectHandle new_contents = newStream(qpdf);
this->replaceKey("/Contents", new_contents);