From c9f6605fb222a131e452fd65acb5df58bc38bef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kleines=20Filmr=C3=B6llchen?= Date: Thu, 18 May 2023 15:51:46 +0200 Subject: [PATCH] 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. --- AK/BitStream.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/BitStream.h b/AK/BitStream.h index f16dfc7d375..97da95b9fa7 100644 --- a/AK/BitStream.h +++ b/AK/BitStream.h @@ -109,7 +109,7 @@ public: } /// Whether we are (accidentally or intentionally) at a byte boundary right now. - ALWAYS_INLINE bool is_aligned_to_byte_boundary() const { return m_bit_offset == 0; } + ALWAYS_INLINE bool is_aligned_to_byte_boundary() const { return m_bit_offset % 8 == 0; } private: Optional m_current_byte;