mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-24 09:57:08 -06:00
build_mask derives its working area from sparse mask geometry grown by feather, so two distant changed pixels could span a canvas-sized rectangle. It then allocated f32 planes (coverage, pixel-mask values, blur scratch) over that area, gigabytes during even a one-pixel render. Check the estimated working bytes before the dense allocation and fall back to the constant default mask above 512 MiB, so pathological geometry degrades feather detail instead of exhausting memory. Finding: 8c04c5ef-a5bd-48f4-bfcf-83615bcf11c0 (CWE-770)