Skip to content

Conversation

@adamreeve
Copy link
Contributor

I found that when flushing a GZipOutputStream no data was not actually written to the underlying stream before it was flushed due to the !deflater_.IsNeedingInput check in DeflaterOutputStream.Deflate.

This PR fixes that and a couple of other related issues I came across when testing:

  • Don't loop forever when reading from an unfinished stream
  • Fix an infinite loop when flushing a deflate output stream with zero compression

I certify that I own, and have sufficient rights to contribute, all source code and related material intended to be compiled or integrated with the source code for the SharpZipLib open source product (the "Contribution"). My Contribution is licensed under the MIT License.

When flushing a GZipOutputStream, ensure we deflate
all data in the input buffer and write it to the
underlying stream before we flush the underlying stream.
DeflaterEngine.DeflateStored would always write more output even if
there was no more input data to write, resulting in an infinite loop.
@piksel piksel added this to the post 1.0 milestone Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants