mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-24 09:57:08 -06:00
Two deep-EXR allocation gaps: - flatten() allocated the flattened output and the full display-window stage (nc f32 samples per pixel) without a limit check; the deep decode only admitted the data window at four bytes per pixel, before the channel layout was known. Pass Limits into flatten and re-check both buffers at the real f32 layout size. - decode_deep built a per-pixel usize block index before validating the chunk's declared packed sizes. Compute the block bounds first, validate the payload is present, then materialize the index, so a truncated or lying chunk is rejected before the index is allocated. Findings: - feb6fcd8-58df-47e2-a04a-d4d81d5565aa (CWE-789, display-stage allocation) - 9c53025d-65f8-4bcc-9161-143a4c5d7f46 (CWE-789, index before payload check)