diff --git a/crates/eps/src/import/ai/style.rs b/crates/eps/src/import/ai/style.rs index e915e5935..68739fb05 100644 --- a/crates/eps/src/import/ai/style.rs +++ b/crates/eps/src/import/ai/style.rs @@ -764,6 +764,19 @@ mod tests { assert_eq!(feather.params["radius"].as_f64(), Some(5.0)); } + #[test] + fn art_styles_ignore_filters_beyond_the_cap() { + const UNIT: &[u8] = b"/BasicFilter :\n(Adobe Feather) 1 0 /Filter ,\n1 /Visible ,\n/Dictionary : /NotRecorded ,\n; /Dict ;\n /Part ,\n"; + let mut data = + Vec::from(b"/KnownStyle :\n(Capped) /Name ,\n/ActiveStyle :\n/CompoundFilter :\n(Chain Style Filter) 0 0 /Filter ,\n1 /Visible ,\n"); + for _ in 0..MAX_FILTERS + 16 { + data.extend_from_slice(UNIT); + } + data.extend_from_slice(b";\n"); + let style = art_styles(&data).remove("Capped").unwrap_or_default(); + assert!(style.effects.len() <= MAX_FILTERS); + } + #[test] fn hostile_dash_offsets_and_width_profiles_are_tamed() { let mut f = Filter::default();