Commit cb3b705cf9738687f32af6248e17c4cafd3dc86c

Authored by Jay Berkenbilt
1 parent 21b7481b

Include filename in object stream parse error

ChangeLog
  1 +2018-02-17 Jay Berkenbilt <ejb@ql.org>
  2 +
  3 + * Error message fix: improve file name in the error message when
  4 + there is a parser error inside an object stream.
  5 +
1 2018-02-11 Jay Berkenbilt <ejb@ql.org> 6 2018-02-11 Jay Berkenbilt <ejb@ql.org>
2 7
3 * Add QPDFObjectHandle::filterPageContents method to provide a 8 * Add QPDFObjectHandle::filterPageContents method to provide a
libqpdf/QPDF.cc
@@ -1847,7 +1847,8 @@ QPDF::resolveObjectsInStream(int obj_stream_number) @@ -1847,7 +1847,8 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
1847 1847
1848 PointerHolder<Buffer> bp = obj_stream.getStreamData(qpdf_dl_specialized); 1848 PointerHolder<Buffer> bp = obj_stream.getStreamData(qpdf_dl_specialized);
1849 PointerHolder<InputSource> input = new BufferInputSource( 1849 PointerHolder<InputSource> input = new BufferInputSource(
1850 - "object stream " + QUtil::int_to_string(obj_stream_number), 1850 + this->m->file->getName() +
  1851 + " object stream " + QUtil::int_to_string(obj_stream_number),
1851 bp.getPointer()); 1852 bp.getPointer());
1852 1853
1853 for (int i = 0; i < n; ++i) 1854 for (int i = 0; i < n; ++i)
qpdf/qtest/qpdf/eof-reading-token.out
@@ -2,4 +2,4 @@ checking eof-reading-token.pdf @@ -2,4 +2,4 @@ checking eof-reading-token.pdf
2 PDF Version: 1.3 2 PDF Version: 1.3
3 File is not encrypted 3 File is not encrypted
4 File is not linearized 4 File is not linearized
5 -WARNING: object stream 12 (file position 5): EOF while reading token 5 +WARNING: eof-reading-token.pdf object stream 12 (file position 5): EOF while reading token
qpdf/qtest/qpdf/issue-143.out
@@ -13,5 +13,5 @@ WARNING: issue-143.pdf (file position 24): expected dictionary key but found non @@ -13,5 +13,5 @@ WARNING: issue-143.pdf (file position 24): expected dictionary key but found non
13 WARNING: issue-143.pdf (object 1 0, file position 21): stream dictionary lacks /Length key 13 WARNING: issue-143.pdf (object 1 0, file position 21): stream dictionary lacks /Length key
14 WARNING: issue-143.pdf (object 1 0, file position 84): attempting to recover stream length 14 WARNING: issue-143.pdf (object 1 0, file position 84): attempting to recover stream length
15 WARNING: issue-143.pdf (object 1 0, file position 84): recovered stream length: 606 15 WARNING: issue-143.pdf (object 1 0, file position 84): recovered stream length: 606
16 -WARNING: object stream 1 (file position 33): expected dictionary key but found non-name object; inserting key /QPDFFake1 16 +WARNING: issue-143.pdf object stream 1 (file position 33): expected dictionary key but found non-name object; inserting key /QPDFFake1
17 qpdf: operation succeeded with warnings; resulting file may have some problems 17 qpdf: operation succeeded with warnings; resulting file may have some problems