Files
effectcraft/crates
Brandon ThomasandClaude Opus 5.5 dc573f77e6 Never crash: PSD reader bounds overflow and input-sized allocations
Layer bounds come straight from the file as four i32s. Rect::width/height subtracted them in
i32 (overflow: a panic in debug builds, garbage sizes in release), and layer_pixels allocated
width x height pixels before reading any data, so a 100-byte file claiming a 2^31-square layer
hit "capacity overflow" (or an out-of-memory abort). Widths are now computed in i64 and
clamped, every decoded image is capped at 2^28 pixels (Error::Unsupported beyond that), zlib
data is inflated with a limit of the expected size, RLE count tables and UTF-16 strings
reserve no more than the remaining bytes, and the per-pixel copy only visits the part of the
layer that lands in the output. Denies the panic lints in the crate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 12:27:18 -04:00
..
2026-10-04 02:57:17 -04:00
2026-10-04 02:57:17 -04:00
2026-10-04 02:57:17 -04:00
2026-10-03 13:13:50 -04:00
2026-10-04 02:57:17 -04:00
2026-10-03 02:25:56 -04:00
2026-10-04 02:57:17 -04:00