Files
photocraft/crates
Finn NewickandClaude Opus 5.5 dd57638d9e fix(psd): make packbits::decode_into crate-private and overflow-safe
decode_into computed out.len() + expected unchecked. With a non-empty
buffer and an expected length near usize::MAX it panicked in debug builds
and, in release, wrapped and returned Ok having decoded nothing. Compute
the target with checked_add and report LimitExceeded, and test each packet
as len > target - out.len() so the bound checks cannot overflow either.

The only callers are decode and decode_rle in this module, and the crate
README documents packbits::{encode, decode} as the public API, so
decode_into becomes pub(crate).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 10:11:57 +01:00
..
…
…