mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 02:49:00 +00:00
Add test case for self-referential object streams
Previous test case was lost in #1221. Test file was created from object-stream.pdf by adding a reference to itself into object stream 1 0.
This commit is contained in:
parent
edf3509b78
commit
f0ded6bca8
@ -17,6 +17,11 @@
|
||||
* Add static option to Pl_DCT to control whether decompression of
|
||||
corrupt JPEG data is attempted.
|
||||
|
||||
2024-07-01 M Holger <m.holger@qpdf.org>
|
||||
|
||||
* Bug fix: certain invalid object streams caused the insertion of
|
||||
invalid entries into in the xref table.
|
||||
|
||||
2024-06-29 M Holger <m.holger@qpdf.org>
|
||||
|
||||
* Bug fix: in QPDFOutlineObjectHelper detect loops in the list of
|
||||
|
@ -1938,6 +1938,7 @@ QPDF::resolveObjectsInStream(int obj_stream_number)
|
||||
continue;
|
||||
}
|
||||
if (num == obj_stream_number) {
|
||||
QTC::TC("qpdf", "QPDF ignore self-referential object stream");
|
||||
warn(damagedPDF(
|
||||
input,
|
||||
m->last_object_description,
|
||||
|
@ -4,6 +4,7 @@ QPDF err wrong objid/generation 0
|
||||
QPDF check objid 1
|
||||
QPDF check generation 1
|
||||
QPDF check obj 1
|
||||
QPDF ignore self-referential object stream 0
|
||||
QPDF hint table length indirect 0
|
||||
QPDF hint table length direct 0
|
||||
QPDF P absent in lindict 0
|
||||
|
@ -16,7 +16,7 @@ cleanup();
|
||||
|
||||
my $td = new TestDriver('object-stream');
|
||||
|
||||
my $n_tests = 7 + (36 * 4) + (12 * 2);
|
||||
my $n_tests = 9 + (36 * 4) + (12 * 2);
|
||||
my $n_compare_pdfs = 36;
|
||||
|
||||
for (my $n = 16; $n <= 19; ++$n)
|
||||
@ -107,5 +107,16 @@ $td->runtest("check file",
|
||||
{$td->FILE => "a.pdf"},
|
||||
{$td->FILE => "recover-xref-stream-recovered.pdf"});
|
||||
|
||||
# Self-referential object stream
|
||||
$td->runtest("self-referential object stream",
|
||||
{$td->COMMAND => "qpdf --static-id --qdf" .
|
||||
" object-stream-self-ref.pdf a.pdf"},
|
||||
{$td->FILE => "object-stream-self-ref.out", $td->EXIT_STATUS => 3},
|
||||
$td->NORMALIZE_NEWLINES);
|
||||
$td->runtest("check file",
|
||||
{$td->FILE => "a.pdf"},
|
||||
{$td->FILE => "object-stream-self-ref.out.pdf"});
|
||||
|
||||
|
||||
cleanup();
|
||||
$td->report(calc_ntests($n_tests, $n_compare_pdfs));
|
||||
|
2
qpdf/qtest/qpdf/object-stream-self-ref.out
Normal file
2
qpdf/qtest/qpdf/object-stream-self-ref.out
Normal file
@ -0,0 +1,2 @@
|
||||
WARNING: object-stream-self-ref.pdf object stream 1 (object 1 0, offset 2): object stream claims to contain itself
|
||||
qpdf: operation succeeded with warnings; resulting file may have some problems
|
BIN
qpdf/qtest/qpdf/object-stream-self-ref.out.pdf
Normal file
BIN
qpdf/qtest/qpdf/object-stream-self-ref.out.pdf
Normal file
Binary file not shown.
BIN
qpdf/qtest/qpdf/object-stream-self-ref.pdf
Normal file
BIN
qpdf/qtest/qpdf/object-stream-self-ref.pdf
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user