Portable-Network-Archive / liblzma-rs

Bindings to liblzma in Rust (xz streams in Rust)
Apache License 2.0
19 stars 5 forks source link

🔧 Fix empty input decoding error #132

Closed shamilsan closed 3 months ago

shamilsan commented 3 months ago

I have a problem with decoding my .7z sample. I get an "premature eof" error when trying to decode a piece of data.

The error is caused by checking status against Status::StreamEnd while it is actually is Status::Ok.

My case:

After the second read I get the error. I've added a check whether status is not Status::Ok when dealing with an empty input (eof=true) before returning an error.

shamilsan commented 3 months ago

Need to investigate.