Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BZip2Error.wrongCRC when decompressing #38

Closed
MBLRN opened this issue Dec 14, 2022 · 2 comments
Closed

BZip2Error.wrongCRC when decompressing #38

MBLRN opened this issue Dec 14, 2022 · 2 comments

Comments

@MBLRN
Copy link

MBLRN commented Dec 14, 2022

Hello
I’m getting a BZip2Error.wrongCRC error using BZip2 with the following file:
problem.dat.zip
The file needs decompressing first before using:

let uncompressed = try Data(contentsOf: "problem.dat")
let compressed = BZip2.compress(data: uncompressed)
let backAgain = try BZip2.decompress(data: compressed)

Cheers.

@tsolomko
Copy link
Owner

Thank you for reporting this issue! It is very peculiar and in fact quite serious.

As it turns out it is not related to CRC computation. Instead, the so called "pointer" was set incorrectly in Burrows-Wheeler transform during BZip2 compression. I am very surprised that no one has encountered this problem until now.

This issue was fixed in b1fe47f.

@tsolomko
Copy link
Owner

The fix was released as part of the 4.8.4 update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants