Corrected reading past last read position.

This commit is contained in:
2017-06-07 17:52:54 +01:00
parent 2f6714d8a0
commit 6249e9e331

View File

@@ -151,7 +151,8 @@ namespace DiscImageChef.Filters
backStream.Position = position;
return;
}
backStream.Position = backStream.Length;
long toposition = position - backStream.Position;
int fullBufferReads = (int)(toposition / bufferLen);
int restToRead = (int)(toposition % bufferLen);
@@ -172,6 +173,7 @@ namespace DiscImageChef.Filters
public override void Flush()
{
baseStream.Flush();
backStream.Flush();
}
public override int Read(byte[] buffer, int offset, int count)