ArgumentOutOfRangeException on Zip expansion #141

Open
opened 2026-01-29 22:07:17 +00:00 by claunia · 0 comments
Owner

Originally created by @dkekesi on GitHub (Nov 7, 2016).

I get the following exception when expanding a certain Zip archive:

System.ArgumentOutOfRangeException: Stream length must be non-negative and less than 2^31 - 1 - origin.
Parameter name: value
at System.IO.MemoryStream.set_Position(Int64 value)
at SharpCompress.Common.Zip.ZipHeaderFactory.ReadHeader(UInt32 headerBytes, BinaryReader reader)
at SharpCompress.Common.Zip.SeekableZipHeaderFactory.GetLocalHeader(Stream stream, DirectoryEntryHeader directoryEntryHeader)
at SharpCompress.Common.Zip.SeekableZipFilePart.LoadLocalHeader()
at SharpCompress.Common.Zip.SeekableZipFilePart.GetCompressedStream()
at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry archiveEntry, Stream streamToWriteTo)

Can you look into what the problem may be? Other programs can expand the Zip. The file itself is merely 300K in size.
Thanks.

Originally created by @dkekesi on GitHub (Nov 7, 2016). I get the following exception when expanding a certain Zip archive: System.ArgumentOutOfRangeException: Stream length must be non-negative and less than 2^31 - 1 - origin. Parameter name: value at System.IO.MemoryStream.set_Position(Int64 value) at SharpCompress.Common.Zip.ZipHeaderFactory.ReadHeader(UInt32 headerBytes, BinaryReader reader) at SharpCompress.Common.Zip.SeekableZipHeaderFactory.GetLocalHeader(Stream stream, DirectoryEntryHeader directoryEntryHeader) at SharpCompress.Common.Zip.SeekableZipFilePart.LoadLocalHeader() at SharpCompress.Common.Zip.SeekableZipFilePart.GetCompressedStream() at SharpCompress.Archives.IArchiveEntryExtensions.WriteTo(IArchiveEntry archiveEntry, Stream streamToWriteTo) Can you look into what the problem may be? Other programs can expand the Zip. The file itself is merely 300K in size. Thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#141