aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF_linearization.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2013-06-15 03:35:10 +0200
committerJay Berkenbilt <ejb@ql.org>2013-06-15 03:36:04 +0200
commit16051788ed6a8209aadff619b586eac86543b4f9 (patch)
tree6262f0eb4d40e56f4d2076da885a57fea96d14aa /libqpdf/QPDF_linearization.cc
parenteae8370cd9c4e6ac748931a425721303561bd6ac (diff)
downloadqpdf-16051788ed6a8209aadff619b586eac86543b4f9.tar.zst
Handle /Outlines dictionary being a direct object
Even though this case is not valid according to the spec, it has been seen, and caused an internal error.
Diffstat (limited to 'libqpdf/QPDF_linearization.cc')
-rw-r--r--libqpdf/QPDF_linearization.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/libqpdf/QPDF_linearization.cc b/libqpdf/QPDF_linearization.cc
index 4b1f5c09..2c4fefc0 100644
--- a/libqpdf/QPDF_linearization.cc
+++ b/libqpdf/QPDF_linearization.cc
@@ -958,6 +958,15 @@ QPDF::checkHOutlines(std::list<std::string>& warnings)
{
// Check length and offset. Acrobat gets these wrong.
QPDFObjectHandle outlines = getRoot().getKey("/Outlines");
+ if (! outlines.isIndirect())
+ {
+ // This case is not exercised in test suite since not
+ // permitted by the spec, but if this does occur, the
+ // code below would fail.
+ warnings.push_back(
+ "/Outlines key of root dictionary is not indirect");
+ return;
+ }
QPDFObjGen og(outlines.getObjGen());
assert(this->xref_table.count(og) > 0);
int offset = getLinearizationOffset(og);