ironfede / openmcdf

Microsoft Compound File .net component - pure C# - netstandard 2.0
Mozilla Public License 2.0
309 stars 76 forks source link

Fix so unallocated directory entries are now spec compliant #78

Closed Sonic-The-Hedgehog-LNK1123 closed 3 years ago

Sonic-The-Hedgehog-LNK1123 commented 3 years ago

See the below quote from the specification:

Free (unused) directory entries are marked with Object Type 0x0 (unknown or unallocated). The entire directory entry must consist of all zeroes except for the child, right sibling, and left sibling pointers, which must be initialized to NOSTREAM (0xFFFFFFFF).

This function:

https://github.com/ironfede/openmcdf/blob/c9d74e2a21cc047d8962032449428fb6ecc45ca4/sources/OpenMcdf/CompoundFile.cs#L1626

Did not reset all required parts it needs to.

Likewise, this:

https://github.com/ironfede/openmcdf/blob/c9d74e2a21cc047d8962032449428fb6ecc45ca4/sources/OpenMcdf/CompoundFile.cs#L2534

was not specifiaction compliant either.

ironfede commented 3 years ago

Thank you @Sonic-The-Hedgehog-LNK1123 , request merged. Best Regards, Federico