Skip to content

Commit ad8a8d0

Browse files
committed
Merge branch 'pldg-master'
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
2 parents ad755c5 + 82ebb8f commit ad8a8d0

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

ICSharpCode.SharpZipLib/Zip/ZipFile.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3673,8 +3673,11 @@ public override int Read(byte[] buffer, int offset, int count)
36733673
return 0;
36743674
}
36753675
}
3676-
3677-
baseStream_.Seek(readPos_, SeekOrigin.Begin);
3676+
// Protect against Stream implementations that throw away their buffer on every Seek
3677+
// (for example, Mono FileStream)
3678+
if (baseStream_.Position != readPos_) {
3679+
baseStream_.Seek(readPos_, SeekOrigin.Begin);
3680+
}
36783681
int readCount = baseStream_.Read(buffer, offset, count);
36793682
if (readCount > 0) {
36803683
readPos_ += readCount;

0 commit comments

Comments
 (0)