psd: retain the non-advancing annotation length guard

This commit is contained in:
David Mann authored and Dylan M. Taylor committed 2026-11-15 07:43:59 -05:00
1 parent 2af0575279
commit 2c3171d734
1 file changed
+10
+10
View File
@@ -41,3 +41,13 @@ fn pascal(out: &mut Vec<u8>, 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(())
}