Skip to content

Commit c9f6605

Browse files
kleinesfilmroellchengmta
authored andcommitted
AK: Account for bit position 8 in bit stream alignment
See identical code in LittleEndianBitStream; even in the bytewise reading BigEndianBitStream an offset of 8 is not inconsistent state and handled just fine by read_bits.
1 parent 70c977a commit c9f6605

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

AK/BitStream.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class BigEndianInputBitStream : public Stream {
109109
}
110110

111111
/// Whether we are (accidentally or intentionally) at a byte boundary right now.
112-
ALWAYS_INLINE bool is_aligned_to_byte_boundary() const { return m_bit_offset == 0; }
112+
ALWAYS_INLINE bool is_aligned_to_byte_boundary() const { return m_bit_offset % 8 == 0; }
113113

114114
private:
115115
Optional<u8> m_current_byte;

0 commit comments

Comments
 (0)