2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-23 03:18:59 +00:00

Fix logic error in recovery

A stray semicolon caused a condition to be incorrectly applied during
stream length recovery.
This commit is contained in:
Jay Berkenbilt 2017-08-22 07:19:41 -04:00
parent ce435222b2
commit 6884ad2ead
4 changed files with 2 additions and 4 deletions

View File

@ -1414,7 +1414,7 @@ QPDF::findEndstream()
QPDFTokenizer::Token t = readToken(this->m->file, true);
if ((t.getType() == QPDFTokenizer::tt_word) &&
((t.getValue() == "endobj") ||
(t.getValue() == "endstream")));
(t.getValue() == "endstream")))
{
this->m->file->seek(this->m->file->getLastOffset(), SEEK_SET);
return true;

View File

@ -11,7 +11,7 @@ WARNING: issue-101.pdf (trailer, file position 1702): attempting to recover stre
WARNING: issue-101.pdf (trailer, file position 1702): recovered stream length: 12
WARNING: issue-101.pdf (trailer, file position 2026): /Length key in stream dictionary is not an integer
WARNING: issue-101.pdf (trailer, file position 2097): attempting to recover stream length
WARNING: issue-101.pdf (trailer, file position 2097): recovered stream length: 12
WARNING: issue-101.pdf (trailer, file position 2097): recovered stream length: 257
WARNING: issue-101.pdf (trailer, file position 2613): /Length key in stream dictionary is not an integer
WARNING: issue-101.pdf (trailer, file position 2684): attempting to recover stream length
WARNING: issue-101.pdf (trailer, file position 2684): recovered stream length: 74

View File

@ -3,7 +3,6 @@ WARNING: issue-143.pdf (xref stream: object 3 0, file position 654): stream keyw
WARNING: issue-143.pdf (xref stream: object 3 0, file position 607): stream dictionary lacks /Length key
WARNING: issue-143.pdf (xref stream: object 3 0, file position 654): attempting to recover stream length
WARNING: issue-143.pdf (xref stream: object 3 0, file position 654): recovered stream length: 36
WARNING: issue-143.pdf (xref stream: object 3 0, file position 694): expected endobj
WARNING: issue-143.pdf: file is damaged
WARNING: issue-143.pdf (object 1 0, file position 48): expected n n obj
WARNING: issue-143.pdf: Attempting to reconstruct cross-reference table
@ -14,6 +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: issue-143.pdf (object 1 0, file position 694): expected endobj
WARNING: 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

Binary file not shown.