Skip to content

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented Mar 31, 2023

Resolves #6963

When PpmImagePlugin is reading an image, it only reads ImageFile.SAFEBLOCK bytes at a time.

So when looping through this data, if there is no space after the last digit, it saves this for the next loop, in case the read operation stopped partway through a series of digits.

Except that half_token isn't cleared after it is used. That means that it keeps getting used, and so infinite data is available to fill the image size.

This PR fixes that.

@radarhere radarhere merged commit 3cd1e12 into python-pillow:main Mar 31, 2023
@radarhere radarhere deleted the ppm_half_token branch March 31, 2023 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PPM "Channel value too large" error

1 participant