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

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