mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-06 06:03:14 +03:00
Merge ddde1b8f9d
into 7e4d8e2f55
This commit is contained in:
commit
8bc1b8fbb5
|
@ -33,11 +33,7 @@ class BitStream:
|
||||||
|
|
||||||
def peek(self, bits: int) -> int:
|
def peek(self, bits: int) -> int:
|
||||||
while self.bits < bits:
|
while self.bits < bits:
|
||||||
c = self.next()
|
self.bitbuffer = (self.bitbuffer << 8) + self.next()
|
||||||
if c < 0:
|
|
||||||
self.bits = 0
|
|
||||||
continue
|
|
||||||
self.bitbuffer = (self.bitbuffer << 8) + c
|
|
||||||
self.bits += 8
|
self.bits += 8
|
||||||
return self.bitbuffer >> (self.bits - bits) & (1 << bits) - 1
|
return self.bitbuffer >> (self.bits - bits) & (1 << bits) - 1
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user