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
merged 1 commit into from Sep 17, 2017

Conversation

Projects
None yet
2 participants
@frabar666
Contributor

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).
@adamhathcock

This comment has been minimized.

Show comment
Hide comment
@adamhathcock

adamhathcock Sep 17, 2017

Owner

I wonder if this fixes #298
Or
#296
Or
#289

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

Owner

adamhathcock commented Sep 17, 2017

I wonder if this fixes #298
Or
#296
Or
#289

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

@frabar666 frabar666 referenced this pull request Sep 17, 2017

Merged

XZ: fix padding issues #300

@adamhathcock adamhathcock merged commit f20c031 into adamhathcock:master Sep 17, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@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