[PR #679] Fix LZMADecoder Code function #1160

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

Original Pull Request: https://github.com/adamhathcock/sharpcompress/pull/679

State: closed
Merged: Yes


It seems using LZMADecoder to attempt to decompress a byte array rise an exception. After investigation, it seems to originate from two statements added to the original 7zip classes :

if (!rangeDecoder.IsFinished || (inSize > 0 && rangeDecoder._total != inSize)) { throw new DataErrorException(); } if (_outWindow.HasPending) { throw new DataErrorException(); }

Removing it seems to fix the issue.
This function is not use elsewhere in the project.

image

Adding it back will cause the test case TestLzmaBuffer to fail.

**Original Pull Request:** https://github.com/adamhathcock/sharpcompress/pull/679 **State:** closed **Merged:** Yes --- It seems using LZMADecoder to attempt to decompress a byte array rise an exception. After investigation, it seems to originate from two statements added to the original 7zip classes : if (!rangeDecoder.IsFinished || (inSize > 0 && rangeDecoder._total != inSize)) { throw new DataErrorException(); } if (_outWindow.HasPending) { throw new DataErrorException(); } Removing it seems to fix the issue. This function is not use elsewhere in the project. ![image](https://user-images.githubusercontent.com/107269782/176054483-7ab570f0-472a-4a5e-9101-d8f4325d8698.png) Adding it back will cause the test case TestLzmaBuffer to fail.
claunia added the pull-request label 2026-01-29 22:19:16 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1160