mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #299] [MERGED] XZ: fix variable-length integers decoding #950
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/adamhathcock/sharpcompress/pull/299
Author: @frabar666
Created: 9/16/2017
Status: ✅ Merged
Merged: 9/17/2017
Merged by: @adamhathcock
Base:
master← Head:fix-vli-decoding📝 Commits (1)
f2ed1dfXZ: fix variable-length integers decoding📊 Changes
2 files changed (+10 additions, -1 deletions)
View changed files
📝
src/SharpCompress/Compressors/Xz/MultiByteIntegers.cs(+1 -1)📝
tests/SharpCompress.Test/Xz/XZIndexTests.cs(+9 -0)📄 Description
The
ReadXZIntegerextension 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:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.