Commit 9a0e9a1a9e6072807cfea78910dd5d85bff48ea2

Authored by Jay Berkenbilt
1 parent 051ae7c2

Remove offset from missing /Root error

The last offset is irrelevant to not being able to find /Root.
libqpdf/QPDF.cc
... ... @@ -2592,7 +2592,7 @@ QPDF::getRoot()
2592 2592 qpdf_e_damaged_pdf,
2593 2593 this->m->file->getName(),
2594 2594 "",
2595   - this->m->file->getLastOffset(),
  2595 + 0,
2596 2596 "unable to find /Root dictionary");
2597 2597 }
2598 2598 return root;
... ...
qpdf/qtest/qpdf/issue-100.out
... ... @@ -14,4 +14,4 @@ WARNING: issue-100.pdf (object 5 0, offset 489): attempting to recover stream le
14 14 WARNING: issue-100.pdf (object 5 0, offset 489): recovered stream length: 12
15 15 WARNING: issue-100.pdf (trailer, offset 953): expected dictionary key but found non-name object; inserting key /QPDFFake1
16 16 WARNING: issue-100.pdf (trailer, offset 953): dictionary ended prematurely; using null as value for last key
17   -qpdf: issue-100.pdf (offset 1144): unable to find /Root dictionary
  17 +qpdf: issue-100.pdf: unable to find /Root dictionary
... ...
qpdf/qtest/qpdf/issue-101.out
... ... @@ -40,4 +40,4 @@ WARNING: issue-101.pdf (object 11 0, offset 639): unknown token while reading ob
40 40 WARNING: issue-101.pdf (object 11 0, offset 644): unknown token while reading object; treating as string
41 41 WARNING: issue-101.pdf (object 11 0, offset 644): too many errors; giving up on reading object
42 42 WARNING: issue-101.pdf (object 11 0, offset 647): expected endobj
43   -qpdf: issue-101.pdf (offset 687): unable to find /Root dictionary
  43 +qpdf: issue-101.pdf: unable to find /Root dictionary
... ...
qpdf/qtest/qpdf/issue-118.out
1 1 WARNING: issue-118.pdf: can't find PDF header
2 2 WARNING: issue-118.pdf (offset 732): loop detected resolving object 2 0
3 3 WARNING: issue-118.pdf (xref stream: object 8 0, offset 732): supposed object stream 2 is not a stream
4   -issue-118.pdf (offset 732): unable to find /Root dictionary
  4 +issue-118.pdf: unable to find /Root dictionary
... ...
qpdf/qtest/qpdf/issue-335a.out
... ... @@ -1313,4 +1313,4 @@ WARNING: issue-335a.pdf (object 5 0, offset 23485): attempting to recover stream
1313 1313 WARNING: issue-335a.pdf (object 5 0, offset 23485): unable to recover stream data; treating stream as empty
1314 1314 WARNING: issue-335a.pdf (object 5 0, offset 24974): expected endobj
1315 1315 WARNING: issue-335a.pdf (object 5 0, offset 24974): EOF after endobj
1316   -qpdf: issue-335a.pdf (offset 24974): unable to find /Root dictionary
  1316 +qpdf: issue-335a.pdf: unable to find /Root dictionary
... ...
qpdf/qtest/qpdf/issue-99.out
1 1 WARNING: issue-99.pdf: file is damaged
2 2 WARNING: issue-99.pdf (offset 3526): xref not found
3 3 WARNING: issue-99.pdf: Attempting to reconstruct cross-reference table
4   -qpdf: issue-99.pdf (offset 4798): unable to find /Root dictionary
  4 +qpdf: issue-99.pdf: unable to find /Root dictionary
... ...
qpdf/qtest/qpdf/issue-99b.out
... ... @@ -2,4 +2,4 @@ WARNING: issue-99b.pdf: file is damaged
2 2 WARNING: issue-99b.pdf (object 1 0, offset 9): object with ID 0
3 3 WARNING: issue-99b.pdf: Attempting to reconstruct cross-reference table
4 4 WARNING: issue-99b.pdf: object 1 0 not found in file after regenerating cross reference table
5   -qpdf: issue-99b.pdf (offset 763): unable to find /Root dictionary
  5 +qpdf: issue-99b.pdf: unable to find /Root dictionary
... ...