Prevent crash by only loading data if file offset is greater than zero
This commit is contained in:
parent
9a8ba33563
commit
5e6ca81e32
@ -605,12 +605,14 @@ namespace UniversalEditor.DataFormats.FileSystem.FAT
|
||||
file.Attributes = fi.Attributes;
|
||||
|
||||
long pos = br.Accessor.Position;
|
||||
br.Accessor.Position = fileOffset;
|
||||
byte[] data = br.ReadBytes(fi.Length);
|
||||
if (fileOffset > 0)
|
||||
{
|
||||
br.Accessor.Position = fileOffset;
|
||||
byte[] data = br.ReadBytes(fi.Length);
|
||||
file.SetDataAsByteArray(data);
|
||||
}
|
||||
br.Accessor.Position = pos;
|
||||
|
||||
file.SetDataAsByteArray(data);
|
||||
|
||||
fsom.Files.Add(file);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user