bzip2-rs icon indicating copy to clipboard operation
bzip2-rs copied to clipboard

BlockError: `huffman bitstream truncated`

Open KiruyaMomochi opened this issue 2 years ago • 1 comments

This error occurs when I'm decoding an Android update payload. Dump file (not actually zipped, change extension to .bz2): dump.zip

let mut decoder = bzip2_rs::DecoderReader::new(input?);
// The next statement returns BlockError { reason: "huffman bitstream truncated" }
let copied = std::io::copy(&mut decoder, &mut output);

bzip2 = "0.4" decoded this file successfully.

KiruyaMomochi avatar Jul 14 '22 21:07 KiruyaMomochi

I'm experiencing the same problem using this file:

https://ftp.mozilla.org/pub/firefox/releases/89.0.2/linux-x86_64/en-US/firefox-89.0.2.tar.bz2

Here is a basic example reproducing the problem:

https://github.com/bonigarcia/rust-examples/blob/main/bzip2/src/main.rs

bonigarcia avatar Aug 21 '23 13:08 bonigarcia