mirror of
https://github.com/storytold/craft-libs.git
synced 2026-10-31 15:49:54 +00:00
* pdf: keep a CID font's /W2 table past an out-of-range first CID; vendor hayro-cmap from PdfCraft - hayro-interpret: a /W2 run whose first CID is past 65535 is skipped, as in /W. A run starting at 4294967295 overflowed the CID counter and discarded the whole table. Unit test in font::cid. - hayro-cmap 0.1.0 is vendored from PdfCraft a2ec27b47 with its malformed-CMap patch (PdfCraft #3177): bad bfchar/bfrange entries, an unresolvable usecmap and an unparseable tail are skipped instead of failing the whole CMap. The crate's tests come with it. Wired up like the other vendored Hayro crates (workspace exclude, patch entry, SOURCE.json, backend test script); NOTICE, ATTRIBUTION.md and vendor/README.craft-reader.md record the source. * hayro-syntax: refuse an xref-stream subsection that runs past object number u32::MAX The object number was start + i in unchecked u32: a subsection starting near u32::MAX overflowed (a panic in debug builds, a wrong object number in release). Covered in xref::tests::xref_stream_entries_need_backing_bytes. * hayro-cmap: a binary usecmap counts against the nesting limit; /W2 checks the CID first - hayro-cmap: a binary CMap's usecmap passed its own depth to the nested parse, so a self-referencing binary CMap recursed until the stack overflowed. It now counts like a text usecmap. Test: self_referencing_binary_usecmap_stops_at_the_nesting_limit. - hayro-interpret: the /W2 first-CID check runs before the run's metrics are read, so an incomplete run past CID 65535 no longer discards the rest of the table. * hayro-syntax: refuse xref-stream object numbers past i32::MAX ObjectIdentifier stores an i32; a number between i32::MAX and u32::MAX was cast to a negative object number.