adamhathcock / sharpcompress

SharpCompress is a fully managed C# library to deal with many compression types and formats.
MIT License
2.29k stars 482 forks source link

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

Open 5andr0 opened 2 months ago

5andr0 commented 2 months ago
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

adamhathcock commented 2 months ago

PRs are welcome