Padding calculation wrong when starting position % 4 != 0 #663

Closed
opened 2026-01-29 22:15:28 +00:00 by claunia · 1 comment
Owner

Originally created by @5andr0 on GitHub (Sep 25, 2024).

private void SkipPadding()
    {
        var bytes = (int)(BaseStream.Position % 4);

I have a BaseStream where the xz file doesn't start at position 0. If this position is not dividable by 4, then the padding calculation is wrong.
Please fix this by calculating the position from the starting position.
Thanks

Originally created by @5andr0 on GitHub (Sep 25, 2024). ``` private void SkipPadding() { var bytes = (int)(BaseStream.Position % 4); ``` I have a BaseStream where the xz file doesn't start at position 0. If this position is not dividable by 4, then the padding calculation is wrong. Please fix this by calculating the position from the starting position. Thanks
claunia added the bugup for grabs labels 2026-01-29 22:15:28 +00:00
Author
Owner

@adamhathcock commented on GitHub (Sep 26, 2024):

PRs are welcome

@adamhathcock commented on GitHub (Sep 26, 2024): PRs are welcome
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#663