Skip to content

Commit

Permalink
fix: infinity loop with empty output buffer in Deflate64Decoder
Browse files Browse the repository at this point in the history
  • Loading branch information
anatawa12 committed Jul 16, 2024
1 parent ed5a6bc commit 77a75ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl<R: BufRead> Read for Deflate64Decoder<R> {
));
}

if result.bytes_written == 0 && !eof && !self.inflater.finished() {
if result.bytes_written == 0 && !eof && !self.inflater.finished() && !buf.is_empty() {
// if we haven't ready any data and we haven't hit EOF yet,
// ask again. We must not return 0 in such case
continue;
Expand Down

0 comments on commit 77a75ed

Please sign in to comment.