Files
pdfcraft/crates/render
mtlcl410andClaude Opus 5.5 b6f93a3aef M2: every match on RenderWarning names MalformedIndexedImage, and an Indexed lookup string given by reference is read (ISO 32000-2 8.6.6.3)
- render_warning_text (crates/automation/src/pages.rs, on main since this
  branch was cut) matched RenderWarning exhaustively and did not build
  with the new variant. It now names it, in the CLI's words, so
  page_render and render_preview report the skip. A workspace search
  finds no other match on RenderWarning outside pdfcraft-render.
- An Indexed lookup is a string or a stream (8.6.6.3). Indexed::new and
  is_malformed_indexed tried it as a stream first; a failed stream read
  of a reference consumed the reference, so a string lookup given by
  reference was never found and the image was skipped. The lookup is now
  read once and dispatched by type, in both places.
- hival is judged before the base: an out-of-range hival rules the space
  out even when the base cannot be read (the table size still needs the
  base, so a usable hival keeps today's handling there).

The size check is unchanged: hival is range-checked to 0..=255 before
(hival + 1) * m is formed with checked_add/checked_mul.

Tests (each seen failing with a fault injected): bounds at DeviceCMYK,
DeviceGray and hival 255 (exact and one short); hivals past u32/u64/any
integer, negative and fractional (with unchecked arithmetic and the range
widened the test panics with "attempt to multiply with overflow"); a
lookup string by reference (fails with the old stream-then-string read);
an unreadable base with hival 300; an undecodable lookup stream; and
page_render reporting the skip (without the new arm the crate does not
build, E0004).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
2026-11-01 19:20:55 +08:00
..