diff options
author | Jay Berkenbilt <ejb@ql.org> | 2010-09-06 04:17:55 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2010-09-06 04:17:55 +0200 |
commit | 047bcfcaa605d8a3433bea27a1e82dc0067822c9 (patch) | |
tree | 384ea993deff11a857fc09ae0d07001e681c1baa /libqpdf | |
parent | 1dade9a7ee0a8aba935fbf81a4ee7891a83285a2 (diff) | |
download | qpdf-047bcfcaa605d8a3433bea27a1e82dc0067822c9.tar.zst |
treat empty objects as null
git-svn-id: svn+q:///qpdf/trunk@1027 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDF.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index 0ee097d5..2d8f55a1 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -1197,6 +1197,20 @@ QPDF::readObjectInternal(InputSource* input, olist.pop_back(); olist.pop_back(); } + else if ((value == "endobj") && + (! (in_array || in_dictionary))) + { + // Nothing in the PDF spec appears to allow empty + // objects, but they have been encountered in + // actual PDF files and Adobe Reader appears to + // ignore them. + warn(QPDFExc(qpdf_e_damaged_pdf, input->getName(), + this->last_object_description, + input->getLastOffset(), + "empty object treated as null")); + object = QPDFObjectHandle::newNull(); + input->seek(input->getLastOffset(), SEEK_SET); + } else { throw QPDFExc(qpdf_e_damaged_pdf, input->getName(), |