ironfede / openmcdf

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

Fix out-of-range exception in OLEPropertiesContainer.Save #97

Closed Numpsy closed 9 months ago

Numpsy commented 10 months ago

refs #47

I tried doing a test with adding a user defined property to a documentand got an ArgumentOutOfRange exception:

List`1.get_Item(Int32 index)
PropertySetStream.Write(BinaryWriter bw) line 218
OLEPropertiesContainer.Save(CFStream cfStream) line 264

which looks to be because it sets the number of properties to this.UserDefinedProperties.Properties.Count() but then populates the data with this.properties.

The overall write alas still doesn't seem to work, but this particular exception goes away

ironfede commented 9 months ago

Many thanks @Numpsy for your fixes