paolobarbolini / bzip2-rs

Pure Rust bzip2 decoder
Apache License 2.0
45 stars 6 forks source link

BlockError: `huffman bitstream truncated` #13

Open KiruyaMomochi opened 2 years ago

KiruyaMomochi commented 2 years ago

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.

bonigarcia commented 1 year ago

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