Skip to content

Conversation

@radarhere
Copy link
Member

def i8(c: bytes) -> int:
return c[0]

def next(self) -> int:
return i8(self.fp.read(1))
def peek(self, bits: int) -> int:
while self.bits < bits:
c = self.next()
if c < 0:
self.bits = 0
continue

c < 0 will never be True. The value can range from 0 to 255, but will never be less than zero.

@radarhere radarhere merged commit 892fd2c into python-pillow:main Jun 1, 2025
55 checks passed
@Metallicow
Copy link
Contributor

Metallicow commented Jun 1, 2025

Ok. Fair enough.
Unless it is double masked on purpose, but
I wouldn't see much of an issue, other than a dead body. At which point, I'm not much of a facilitator of anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants