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

Add uncompressed chunk padding #29

Merged
merged 1 commit into from
Aug 12, 2021
Merged

Conversation

Starwarsfan2099
Copy link
Contributor

On a strange edge case, the final chunk of a file can be larger than chunk_size when compressed and smaller than chunk_size when uncompressed. If the compressed chunk is larger than chunk_size, the uncompressed chunk is used. However, since the uncompressed final chunk is smaller than chunk_size, when extracting, pyaff4 attempts to decompress the uncompressed chunk leading to a snappy.UncompressError error. Adding a check and padding any uncompressed chunk less than chunk_size allows for proper extraction of the files from the container and no errors. This was found when a single file out of 34,274 files created this error.

@blschatz blschatz merged commit 94a3583 into aff4:master Aug 12, 2021
@blschatz
Copy link
Member

Thanks @Starwarsfan2099. Good catch!

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

Successfully merging this pull request may close these issues.

2 participants