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

XZ: fix variable-length integers decoding #299

merged 1 commit into from Sep 17, 2017


Copy link

@frabar666 frabar666 commented Sep 16, 2017

The ReadXZInteger extension method reads VLIs in XZ streams. It reads the right number of bytes, but does not return the correct value for multi-byte VLIs (>= 128) because an increment is missing.

This PR adds the missing increment, with a unit test (based on XZIndex). The fix matches the reference Java implementation.

I see two cases where a valid XZ file could previously not be read:

  • XZ file with an index containing >= 128 records (AFAIK indexes aren't that common),
  • block filter with >= 128 bytes of properties (seems unlikely).
Copy link

@adamhathcock adamhathcock commented Sep 17, 2017

I wonder if this fixes #298

I won’t be able to test for a few days. Thanks for this.

@frabar666 frabar666 mentioned this pull request Sep 17, 2017
@adamhathcock adamhathcock merged commit f20c031 into adamhathcock:master Sep 17, 2017
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
@frabar666 frabar666 deleted the frabar666:fix-vli-decoding branch Sep 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.