diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test index a3b5f176..7a8d0fb2 100644 --- a/qpdf/qtest/qpdf.test +++ b/qpdf/qtest/qpdf.test @@ -338,7 +338,7 @@ for (my $n = 16; $n <= 19; ++$n) show_ntests(); # ---------- $td->notify("--- Specific File Tests ---"); -$n_tests += 2; +$n_tests += 3; $n_compare_pdfs += 1; # Special PDF files that caused problems at some point @@ -361,6 +361,11 @@ $td->runtest("convert to qdf", compare_pdfs("old-and-complex.pdf", "a.qdf"); +$td->runtest("damaged stream", + {$td->COMMAND => "qpdf --check damaged-stream.pdf"}, + {$td->FILE => "damaged-stream.out", $td->EXIT_STATUS => 3}, + $td->NORMALIZE_NEWLINES); + show_ntests(); # ---------- $td->notify("--- Mutability Tests ---"); diff --git a/qpdf/qtest/qpdf/damaged-stream.out b/qpdf/qtest/qpdf/damaged-stream.out new file mode 100644 index 00000000..a5ac0c4c --- /dev/null +++ b/qpdf/qtest/qpdf/damaged-stream.out @@ -0,0 +1,4 @@ +checking damaged-stream.pdf +File is not encrypted +File is not linearized +WARNING: damaged-stream.pdf: offset 426: error decoding stream data for object 5 0: LZWDecoder: bad code received diff --git a/qpdf/qtest/qpdf/damaged-stream.pdf b/qpdf/qtest/qpdf/damaged-stream.pdf new file mode 100644 index 00000000..32e7713f Binary files /dev/null and b/qpdf/qtest/qpdf/damaged-stream.pdf differ