mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-27 13:57:18 +00:00
A DecodeBudget bounds what a stream's filter stages make together, and the first commit passed it each stream's own limit, so a /CIDToGIDMap of 65,536 CIDs behind ASCIIHex and Flate (131,072 bytes, with the hex stage's output on top) went unread, where a decode without an allowance bounds each stage alone and read it. Every Metrics::from_dict caller saw the font as missing those glyphs. The 16 MiB limits on CMaps and programs had the same edge. Each stage may now make up to the stream's own limit, as before, and the allowance pays for all of them; what the stream decodes to stays within its limit. Found by the Consumers review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmsdeUCdTaD72jkDw2pJKY