Include filename in object stream parse error

This commit is contained in:
Jay Berkenbilt 2018-02-15 23:24:45 -05:00
parent 21b7481b0e
commit cb3b705cf9
4 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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