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

Open
opened 2026-01-29 22:15:26 +00:00 by claunia · 0 comments
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:26 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#660