gendx / lzma-rs

An LZMA decoder written in pure Rust
MIT License
127 stars 27 forks source link

Extraction fails with `Unknown filter id 8` #98

Open ajeetdsouza opened 1 year ago

ajeetdsouza commented 1 year ago

Test code

fn main() {
    let file = std::fs::File::open("/tmp/dump.xz").unwrap();
    lzma_rs::xz_decompress(&mut std::io::BufReader::new(file), &mut std::io::sink()).unwrap();
}

Output of above program

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: XzError("Unknown filter id 8")', src/main.rs:5:86
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Output of xz -l dump.xz

Strms  Blocks   Compressed Uncompressed  Ratio  Check   Filename
    1       1    683.7 KiB  2,048.0 KiB  0.334  None    dum

Link to file (please extract the dump.zip to get xz file): dump.zip

ajeetdsouza commented 1 year ago

I experienced a similar error with the xz2 crate, perhaps the issue is related? It works fine with rust-lzma.

gendx commented 1 year ago

For now, custom XZ filters are not implemented, but I see that #101 is proposing an implementation for the delta filter. Feel free to send a PR to add an implementation of this filter.