mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-03 21:23:38 +00:00
[PR #722] [MERGED] Zip Multipart fix, XZ stream fix, XZ stream support added to zip/zipx #1180
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/722
Author: @Nanook
Created: 2/2/2023
Status: ✅ Merged
Merged: 3/1/2023
Merged by: @adamhathcock
Base:
master← Head:fixes-XZ-zip📝 Commits (2)
48a341bSplit archive handling fix. XZ stream decoding bug fix (in X64Convert filter). XZ stream support added to zip/zipx.b9d0195Added the XZ zipx unit test.📊 Changes
7 files changed (+92 additions, -64 deletions)
View changed files
📝
src/SharpCompress/Common/Zip/ZipCompressionMethod.cs(+1 -0)📝
src/SharpCompress/Common/Zip/ZipFilePart.cs(+5 -0)📝
src/SharpCompress/Compressors/Filters/BranchExecFilter.cs(+75 -61)📝
src/SharpCompress/IO/ReadOnlySubStream.cs(+6 -2)📝
src/SharpCompress/IO/SourceStream.cs(+1 -0)📝
tests/SharpCompress.Test/Zip/ZipArchiveTests.cs(+4 -1)➕
tests/TestArchives/Archives/WinZip27_XZ.zipx(+0 -0)📄 Description
Split archives using SourceStream.cs were not moving on to the next part when a call Read() spanned 2 parts.
XZ stream support added to zip and zipx. (Which are created by WinZip)
The XZ decoder had a bug that was corrupting data sometimes without error. This was noticed when adding the unit test for WinZip27.XZ.zipx. The previous code fails with this zip (2 bytes in the middle of the exe are invalid). The fix was to re-port X86Converter() in BranchExecFilter.cs. I used a version from https://github.com/torvalds/linux/blob/master/lib/xz/xz_dec_bcj.c
I will also submit a PR that adds Zstandard to zip/zipx and 7zip. Currently this uses a 3rd party nuget package, I don't expect it to be merged, but it might serve as a reference.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.