2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-06-05 20:00:53 +00:00

Add test case of dangling ref not found until xref reconstruction

This commit is contained in:
Jay Berkenbilt 2022-11-25 15:15:46 -05:00
parent 32251497c1
commit 19a8d3fea2
4 changed files with 130 additions and 1 deletions

View File

@ -14,7 +14,7 @@ cleanup();
my $td = new TestDriver('dangling-refs');
my @dangling = (qw(minimal dangling-refs));
my @dangling = (qw(minimal dangling-refs dangling-bad-xref));
my $n_tests = 2 * scalar(@dangling);
foreach my $f (@dangling)

Binary file not shown.

View File

@ -0,0 +1,19 @@
WARNING: dangling-bad-xref.pdf: file is damaged
WARNING: dangling-bad-xref.pdf (object 7 0, offset 10000): expected n n obj
WARNING: dangling-bad-xref.pdf: Attempting to reconstruct cross-reference table
new object: 13 0 R
all objects
1 0 R
2 0 R
3 0 R
4 0 R
5 0 R
6 0 R
7 0 R
8 0 R
9 0 R
10 0 R
11 0 R
12 0 R
13 0 R
test 53 done

View File

@ -0,0 +1,110 @@
%PDF-1.3
%¿÷¢þ
%QDF-1.0
1 0 obj
<<
/Pages 2 0 R
/Type /Catalog
/Dangling 8 0 R
/AlsoDangling [
9 0 R
<<
/yes 2 0 R
/no 10 0 R
/nope 8 0 R
>>
]
>>
endobj
2 0 obj
<<
/Count 1
/Kids [
3 0 R
]
/Type /Pages
>>
endobj
%% Page 1
3 0 obj
<<
/Contents 4 0 R
/MediaBox [
0
0
612
792
]
/Parent 2 0 R
/Resources <<
/Font <<
/F1 6 0 R
>>
/ProcSet 7 0 R
>>
/Type /Page
>>
endobj
%% Contents for page 1
4 0 obj
<<
/Length 5 0 R
>>
stream
BT
/F1 24 Tf
72 720 Td
(Potato) Tj
ET
endstream
endobj
5 0 obj
44
endobj
6 0 obj
<<
/BaseFont /Helvetica
/Encoding /WinAnsiEncoding
/Name /F1
/Subtype /Type1
/Type /Font
>>
endobj
7 0 obj
[
/PDF
/Text
]
endobj
11 0 obj
[
12 0 R
]
endobj
xref
0 8
0000000000 65535 f
0000000025 00000 n
0000000195 00000 n
0000000277 00000 n
0000000492 00000 n
0000000591 00000 n
0000000610 00000 n
0000010000 00000 n
trailer <<
/Root 1 0 R
/Size 8
/ID [<7141a6cf32de469328cf0f51982b5f89><7141a6cf32de469328cf0f51982b5f89>]
>>
startxref
793
%%EOF