mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-24 09:57:08 -06:00
decode_comps matched each nonzero layer-setting comp ID against the comp vector with iter_mut().find(), an O(n*m) scan over two file-controlled collections. A crafted PSD could cause quadratic CPU work during import. Build a comp-ID-to-first-index map once and use it for setting lookups. or_insert preserves first-match behavior for duplicate comp IDs; comp 0 (Last Document State) is still handled separately. Finding: 47567ac0-a75f-4557-b127-ffc855e5bd8d (CWE-407)