mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-30 21:16:52 -06:00
The ROI crop clamped every converted edge to +/-20_000 px, which changed valid crops: a supported 30_000 x 100 frame at scale 1 with ROI [10000, 0, 20000, 100] produced 10_000 x 100 instead of 20_000 x 100. Valid edges reach about 120_000 px (30_000 px at render scale 4.0). Clamp converted edges to +/-1_000_000 instead, subtract from the frame size in i64 and narrow to i32 with saturation, and widen the arithmetic in OutputModule::frame_size to match. Hostile quads (huge, inf, NaN) still degrade to a valid 1 px frame without overflow. Regression test next to hostile_roi_cannot_overflow_crop_math covers the 30_000 x 100 case, a scale 4.0 wide case and hostile inputs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FYXhNN7W7nB6sKjwwU7CDM