Skip to content

XZ: fix padding issues#300

Merged
adamhathcock merged 4 commits intoadamhathcock:masterfrom
frabar666:fix-padding
Sep 17, 2017
Merged

XZ: fix padding issues#300
adamhathcock merged 4 commits intoadamhathcock:masterfrom
frabar666:fix-padding

Conversation

@frabar666
Copy link
Contributor

@frabar666 frabar666 commented Sep 17, 2017

SkipPadding in XZBlock and XZIndex did not always skip the right number of bytes:

  • block padding size computation used decompressed instead of compressed bytes,
  • and both were wrong for even numbers of bytes (skipped 1 when they should have skipped 3, and vice-versa).

This PR fixes both SkipPadding methods, resolves #289 and resolves #296.
I added unit tests using two new inline XZ files (an empty one, and one with 2 blocks), in order to test more cases.

Note that this relies on my previous PR #299: I created a new branch on top of the one I used for the previous PR, not sure if that was the right way to go...

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.

Block header corrupt on correct XZ file 'Block header corrupt' when decompressing xz file

2 participants