mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
flate zlib fix end of block reading
`n` is wanted number of bits to toss `buffered_n` is actual number of bytes in `next_int`
This commit is contained in:
parent
d8cecffe31
commit
d2149106a6
1 changed files with 1 additions and 1 deletions
|
|
@ -603,7 +603,7 @@ fn tossBitsEnding(d: *Decompress, n: u4) !void {
|
|||
error.EndOfStream => unreachable,
|
||||
};
|
||||
d.next_bits = next_int >> needed_bits;
|
||||
d.remaining_bits = @intCast(@as(usize, n) * 8 -| @as(usize, needed_bits));
|
||||
d.remaining_bits = @intCast(@as(usize, buffered_n) * 8 -| @as(usize, needed_bits));
|
||||
}
|
||||
|
||||
fn takeBitsRuntime(d: *Decompress, n: u4) !u16 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue