mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-16 23:42:27 +00:00
psd: retain the non-advancing annotation length guard
This commit is contained in:
1 parent
2af0575279
commit
2c3171d734
1 file changed
+10
@@ -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(())
|
||||
}
|
||||
Reference in new issue
Block a user