summaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDF.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libqpdf/QPDF.cc')
-rw-r--r--libqpdf/QPDF.cc14
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(),