Trim the DataRequest so it only returns actual data, not padding (which could contain other sectors' data)

This commit is contained in:
Michael Becker 2014-10-24 22:11:30 -04:00
parent fba1356540
commit 257d616882

View File

@ -326,7 +326,6 @@ namespace UniversalEditor.DataFormats.FileSystem.Microsoft.CompoundDocument
if (length < mvarMinimumStandardStreamSize)
{
// use the short-sector allocation table and short stream container stream
byte[] data = new byte[sectors.Count * mvarShortSectorSize];
int start = 0;
foreach (int sector in sectors)
@ -337,7 +336,7 @@ namespace UniversalEditor.DataFormats.FileSystem.Microsoft.CompoundDocument
Array.Copy(sectorData, 0, data, start, sectorData.Length);
start += (int)mvarShortSectorSize;
}
e.Data = data;
Array.Copy(data, 0, realdata, 0, realdata.Length);
}
else
{
@ -351,8 +350,9 @@ namespace UniversalEditor.DataFormats.FileSystem.Microsoft.CompoundDocument
Array.Copy(sectorData, 0, data, start, sectorData.Length);
start += (int)mvarSectorSize;
}
e.Data = data;
Array.Copy(data, 0, realdata, 0, realdata.Length);
}
e.Data = realdata;
}
protected override void SaveInternal(ObjectModel objectModel)