Skip to content

Commit

Permalink
Bug Fix: Fix domain errors
Browse files Browse the repository at this point in the history
The `Slice()` methods should use paraemters in the domain of the slice,
rather than the domain of the wrapped stream.
  • Loading branch information
DanRStevens committed Feb 3, 2019
1 parent d70e1c3 commit 2282c34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Stream/FileSliceReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ namespace Stream

FileSliceReader FileSliceReader::Slice(uint64_t sliceLength)
{
FileSliceReader slice = Slice(wrappedStream.Position(), sliceLength);
FileSliceReader slice = Slice(Position(), sliceLength);

// Wait until slice is successfully created before seeking forward.
SeekForward(sliceLength);
Expand All @@ -128,6 +128,6 @@ namespace Stream
);
}

return FileSliceReader(wrappedStream, sliceStartPosition, sliceLength);
return FileSliceReader(wrappedStream, this->startingOffset + sliceStartPosition, sliceLength);
}
}

0 comments on commit 2282c34

Please sign in to comment.