浏览代码

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.
kleines Filmröllchen 2 年之前
父节点
当前提交
c9f6605fb2
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      AK/BitStream.h

+ 1 - 1
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<u8> m_current_byte;