From 9090afea1c99662f6ed7cabaa13303578792fea9 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Sat, 24 Oct 2026 17:46:36 +0700 Subject: [PATCH] .ai palette: color groups are capped as swatches are --- crates/eps/src/import/ai/palette.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/eps/src/import/ai/palette.rs b/crates/eps/src/import/ai/palette.rs index 4769c4cf4..bf659cfe9 100644 --- a/crates/eps/src/import/ai/palette.rs +++ b/crates/eps/src/import/ai/palette.rs @@ -118,7 +118,10 @@ pub(super) fn palette(data: &[u8]) -> Palette { }); } "Pg" => { - if let Some(name) = first_text(&vals) { + // Capped as swatches are: a file of many `Pg` would make as many empty groups. + if let Some(name) = first_text(&vals) + && out.groups.len() < MAX_SWATCHES + { out.groups.push((name, Vec::new())); } }