1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//! Cyclic and deep object graphs given to `check_pdfa`.
//!
//! The checker walks the object graph rather than the content streams, and
//! two of its walks recurse: the page tree through `/Kids`, and a page's
//! resources through a form `XObject`'s own `/Resources` (ISO 32000-1
//! §7.7.3.2 and §8.10.1). Neither shape is bounded by the parser, because
//! each level is a fresh fetch of an already-parsed object. A Rust stack
//! overflow aborts the process rather than unwinding, so a malformed file
//! reaching one of these walks would take down every other request sharing
//! it; these tests pin that the walks terminate with a report instead.
// `clippy.toml`'s `allow-expect-in-tests` does not reach the helper below,
// and a fixture that will not open is the failure signal there.
use ;
/// A form `XObject` whose `/Resources` names the same form: the resource
/// walk admits each form once, so the cycle is one extra level rather than
/// an unbounded descent.
/// A page tree deeper than `Limits::max_page_tree_depth`, built from direct
/// `/Kids` dictionaries that carry no object number for the visited set to
/// remember. The depth cap is what stops it.