aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2018-02-16 05:24:45 +0100
committerJay Berkenbilt <ejb@ql.org>2018-02-19 03:06:27 +0100
commitcb3b705cf9738687f32af6248e17c4cafd3dc86c (patch)
tree5b04d5ab43a56dd8c49362ccf93081045f3e98d9
parent21b7481b0e6a47665eb9a804c34470d85d3c7f93 (diff)
downloadqpdf-cb3b705cf9738687f32af6248e17c4cafd3dc86c.tar.zst
Include filename in object stream parse error
-rw-r--r--ChangeLog5
-rw-r--r--libqpdf/QPDF.cc3
-rw-r--r--qpdf/qtest/qpdf/eof-reading-token.out2
-rw-r--r--qpdf/qtest/qpdf/issue-143.out2
4 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0c298abb..119ba0c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2018-02-17 Jay Berkenbilt <ejb@ql.org>
+
+ * Error message fix: improve file name in the error message when
+ there is a parser error inside an object stream.
+
2018-02-11 Jay Berkenbilt <ejb@ql.org>
* Add QPDFObjectHandle::filterPageContents method to provide a
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc
index 3475afe4..379b34b3 100644
--- a/libqpdf/QPDF.cc
+++ b/libqpdf/QPDF.cc
@@ -1847,7 +1847,8 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
PointerHolder<Buffer> bp = obj_stream.getStreamData(qpdf_dl_specialized);
PointerHolder<InputSource> input = new BufferInputSource(
- "object stream " + QUtil::int_to_string(obj_stream_number),
+ this->m->file->getName() +
+ " object stream " + QUtil::int_to_string(obj_stream_number),
bp.getPointer());
for (int i = 0; i < n; ++i)
diff --git a/qpdf/qtest/qpdf/eof-reading-token.out b/qpdf/qtest/qpdf/eof-reading-token.out
index fefc5160..fd4fed16 100644
--- a/qpdf/qtest/qpdf/eof-reading-token.out
+++ b/qpdf/qtest/qpdf/eof-reading-token.out
@@ -2,4 +2,4 @@ checking eof-reading-token.pdf
PDF Version: 1.3
File is not encrypted
File is not linearized
-WARNING: object stream 12 (file position 5): EOF while reading token
+WARNING: eof-reading-token.pdf object stream 12 (file position 5): EOF while reading token
diff --git a/qpdf/qtest/qpdf/issue-143.out b/qpdf/qtest/qpdf/issue-143.out
index 395065a0..376674ae 100644
--- a/qpdf/qtest/qpdf/issue-143.out
+++ b/qpdf/qtest/qpdf/issue-143.out
@@ -13,5 +13,5 @@ WARNING: issue-143.pdf (file position 24): expected dictionary key but found non
WARNING: issue-143.pdf (object 1 0, file position 21): stream dictionary lacks /Length key
WARNING: issue-143.pdf (object 1 0, file position 84): attempting to recover stream length
WARNING: issue-143.pdf (object 1 0, file position 84): recovered stream length: 606
-WARNING: object stream 1 (file position 33): expected dictionary key but found non-name object; inserting key /QPDFFake1
+WARNING: issue-143.pdf object stream 1 (file position 33): expected dictionary key but found non-name object; inserting key /QPDFFake1
qpdf: operation succeeded with warnings; resulting file may have some problems