From 2c3171d73442f4b44aa3a8b0f1b4fc35dd497628 Mon Sep 17 00:00:00 2001 From: David Mann Date: Tue, 13 Oct 2026 02:37:02 +0200 Subject: [PATCH] psd: retain the non-advancing annotation length guard --- crates/psd/src/annotations.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/psd/src/annotations.rs b/crates/psd/src/annotations.rs index c982d3338..b1d309c5a 100644 --- a/crates/psd/src/annotations.rs +++ b/crates/psd/src/annotations.rs @@ -41,3 +41,13 @@ fn pascal(out: &mut Vec, s: &str) { } } + +// Minimum-length guard imported from PhotoCraft b1b3dff8 (David Mann). +fn advancing_record_length(len: usize) -> Option<()> { + // The length counts itself and the type: anything shorter would put the cursor back on + // this entry, and a hostile count would then loop until memory runs out. + if len < 8 { + return None; + } + Some(()) +}