diff options
author | Jay Berkenbilt <ejb@ql.org> | 2017-08-22 13:19:41 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2017-08-22 13:19:41 +0200 |
commit | 6884ad2eadff6795def2dd336a871227bc8c7d7e (patch) | |
tree | 1ae29250b27cb968191de888af7cddc31020a5e1 | |
parent | ce435222b2ae95645a1a0f79a8b1fca443ed3724 (diff) | |
download | qpdf-6884ad2eadff6795def2dd336a871227bc8c7d7e.tar.zst |
Fix logic error in recovery
A stray semicolon caused a condition to be incorrectly applied during
stream length recovery.
-rw-r--r-- | libqpdf/QPDF.cc | 2 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/issue-101.out | 2 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/issue-143.out | 2 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/issue-143.pdf | bin | 707 -> 710 bytes |
4 files changed, 2 insertions, 4 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index f6e62546..caf5ef7b 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -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; diff --git a/qpdf/qtest/qpdf/issue-101.out b/qpdf/qtest/qpdf/issue-101.out index bd457c3a..e147baad 100644 --- a/qpdf/qtest/qpdf/issue-101.out +++ b/qpdf/qtest/qpdf/issue-101.out @@ -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 diff --git a/qpdf/qtest/qpdf/issue-143.out b/qpdf/qtest/qpdf/issue-143.out index 2bf1e40d..395065a0 100644 --- a/qpdf/qtest/qpdf/issue-143.out +++ b/qpdf/qtest/qpdf/issue-143.out @@ -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 diff --git a/qpdf/qtest/qpdf/issue-143.pdf b/qpdf/qtest/qpdf/issue-143.pdf Binary files differindex b4546036..b62e68a2 100644 --- a/qpdf/qtest/qpdf/issue-143.pdf +++ b/qpdf/qtest/qpdf/issue-143.pdf |