diff options
author | Jay Berkenbilt <ejb@ql.org> | 2020-11-04 13:46:46 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2020-11-04 13:46:46 +0100 |
commit | 47f4ebcdac39256b084cdbb91ff04392fca4bb8d (patch) | |
tree | 6d629440a0c4f8a5b12ead41aa17f5401286b6b5 /qpdf/qtest | |
parent | 3e5aaa299a1f6675b73b56061b44ded4216ad34d (diff) | |
download | qpdf-47f4ebcdac39256b084cdbb91ff04392fca4bb8d.tar.zst |
Ignore unused field in xref entry, avoiding range error (fixes #482)
Diffstat (limited to 'qpdf/qtest')
-rw-r--r-- | qpdf/qtest/qpdf.test | 8 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/issue-150.out | 5 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/xref-range.out | 6 | ||||
-rw-r--r-- | qpdf/qtest/qpdf/xref-range.pdf | bin | 0 -> 722 bytes |
4 files changed, 17 insertions, 2 deletions
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test index 8254013b..1c136126 100644 --- a/qpdf/qtest/qpdf.test +++ b/qpdf/qtest/qpdf.test @@ -1496,7 +1496,7 @@ $td->runtest("detect loops in pages structure", show_ntests(); # ---------- $td->notify("--- Xref ---"); -$n_tests += 5; +$n_tests += 6; # Handle file with invalid xref table and object 0 as a regular object # (bug 3159950). @@ -1538,6 +1538,12 @@ $td->runtest("show number of pages", {$td->STRING => "20\n", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); +# Issue 482 -- don't range check fields[2] for xref entry type 0. +$td->runtest("out of range in deleted object", + {$td->COMMAND => "qpdf --check xref-range.pdf"}, + {$td->FILE => "xref-range.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); + show_ntests(); # ---------- $td->notify("--- Overwrite self ---"); diff --git a/qpdf/qtest/qpdf/issue-150.out b/qpdf/qtest/qpdf/issue-150.out index 862b4d1e..f45a0977 100644 --- a/qpdf/qtest/qpdf/issue-150.out +++ b/qpdf/qtest/qpdf/issue-150.out @@ -1,2 +1,5 @@ WARNING: issue-150.pdf: can't find PDF header -overflow/underflow converting 9900000000000000000 to 64-bit integer +WARNING: issue-150.pdf: file is damaged +WARNING: issue-150.pdf: error reading xref: overflow/underflow converting 9900000000000000000 to 64-bit integer +WARNING: issue-150.pdf: Attempting to reconstruct cross-reference table +issue-150.pdf: unable to find trailer dictionary while recovering damaged file diff --git a/qpdf/qtest/qpdf/xref-range.out b/qpdf/qtest/qpdf/xref-range.out new file mode 100644 index 00000000..cb72e559 --- /dev/null +++ b/qpdf/qtest/qpdf/xref-range.out @@ -0,0 +1,6 @@ +checking xref-range.pdf +PDF Version: 1.5 +File is not encrypted +File is not linearized +No syntax or stream encoding errors found; the file may still contain +errors that qpdf cannot detect diff --git a/qpdf/qtest/qpdf/xref-range.pdf b/qpdf/qtest/qpdf/xref-range.pdf Binary files differnew file mode 100644 index 00000000..8a1413d0 --- /dev/null +++ b/qpdf/qtest/qpdf/xref-range.pdf |