diff --git a/src/write.rs b/src/write.rs index 5d80000e..f6d65dd1 100644 --- a/src/write.rs +++ b/src/write.rs @@ -203,7 +203,8 @@ impl BzDecoder { /// /// [`write`]: Self::write pub fn try_finish(&mut self) -> io::Result<()> { - while !self.done { + // If nothing was written, there is no need to loop + while !self.done && self.total_in() > 0 { let _ = self.write(&[])?; } self.dump()