Skip to content

Commit

Permalink
properly encode number of sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
KillingSpark committed Nov 18, 2024
1 parent f60e704 commit a5666c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/encoding/blocks/compressed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ fn encode_seqnum(seqnum: usize, writer: &mut BitWriter<impl AsMut<Vec<u8>>>) {
match seqnum {
1..=127 => writer.write_bits(seqnum as u32, 8),
128..=0x7FFF => {
let upper = ((seqnum >> 8) & 0x80) as u8;
let upper = ((seqnum >> 8) | 0x80) as u8;
let lower = seqnum as u8;
writer.write_bits(upper, 8);
writer.write_bits(lower, 8);
Expand Down

0 comments on commit a5666c9

Please sign in to comment.