Skip to main content

MAX_FUNCTION_DEPTH

Constant MAX_FUNCTION_DEPTH 

Source
pub const MAX_FUNCTION_DEPTH: usize = 8;
Expand description

Maximum nesting depth of type 3 stitching sub-functions — pdfcer policy.

A type 3 function’s /Functions array may itself contain type 3 functions, and nothing in §7.10.4 forbids a cycle through indirect references (5 0 obj << /FunctionType 3 /Functions [5 0 R] … >> is syntactically legal). Without a depth guard, loading that recurses forever.

This is the same class of guard ARCHITECTURE.md §10 requires on every recursive structure walker. Eight levels is far beyond the one or two levels real stitching functions use.