'Block header corrupt' when decompressing xz file #229

Closed
opened 2026-01-29 22:08:43 +00:00 by claunia · 0 comments
Owner

Originally created by @OtherCrashOverride on GitHub (Aug 18, 2017).

I receive a System.IO.InvalidDataException with the above message (Block header corrupt) when trying to decompress a .xz file. It occurs at SharpCompress.Compressors.Xz.XZBlock.CacheHeader().

The xz file decompresses without issue using 7zip. The file tested can be found here:
https://github.com/ayufan-rock64/linux-build/releases/download/0.4.17/xenial-minimal-rock64-0.4.17-85-arm64.img.xz

To reproduce:

  1. Open the file above.
XZStream image = new XZStream(file);
string uncompressed = sr.ReadToEnd();
  1. Observe above mentioned exception.
Originally created by @OtherCrashOverride on GitHub (Aug 18, 2017). I receive a System.IO.InvalidDataException with the above message (Block header corrupt) when trying to decompress a .xz file. It occurs at SharpCompress.Compressors.Xz.XZBlock.CacheHeader(). The xz file decompresses without issue using 7zip. The file tested can be found here: https://github.com/ayufan-rock64/linux-build/releases/download/0.4.17/xenial-minimal-rock64-0.4.17-85-arm64.img.xz To reproduce: 1) Open the file above. 2) ``` XZStream image = new XZStream(file); string uncompressed = sr.ReadToEnd(); ``` 3) Observe above mentioned exception.
claunia added the bugup for grabs labels 2026-01-29 22:08:43 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#229