mdsteele / rust-cfb

Rust library for reading/writing Compound File Binary (structured storage) files
MIT License
44 stars 20 forks source link

Loosen test on directory entries to parse supposedly valid CFB files … #9

Closed ghost closed 3 years ago

ghost commented 3 years ago

…from Altium Designer.

Altium designer creates CFBs with the following:

cdsfsbasu@cdsfmsb3 rust-cfb % target/debug/examples/cfbtool ls TetherLib.SchLib thread 'main' panicked at 'calledResult::unwrap()on anErrvalue: Custom { kind: InvalidData, error: "Malformed directory entry (non-zero storage start sector: fffffffe vs ffffffff)" }', examples/cfbtool.rs:121:50 note: run withRUST_BACKTRACE=1environment variable to display a backtrace

I'm sure they are not compliant, but it is useful to be able to read them. If the correctness is an issue, maybe you can put a feature in place ("loose-mode") or something that ignores these types of non-compliances?

jtran commented 3 years ago

💯 I was having the same error, and I confirmed that this change prevents the error. I haven't tested deeper than that yet.