Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise ValueError if PNG chunks are truncated #6253

Merged
merged 1 commit into from
May 6, 2022

Conversation

radarhere
Copy link
Member

Resolves #6252

Some PNG chunks expect a certain amount of data.
If the chunk doesn't state that it is long enough to contain that data, then errors can occur, as reported in the issue.

Instead, this PR raises a ValueError. As with other operations in PngImagePlugin, ImageFile.LOAD_TRUNCATED_IMAGES = True can be used to silence these errors.

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.

[PNG] struct.error is raised when there is the broken IHDR chunk after the IDAT chunk
2 participants