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

PIL.ImageOps.exif_transpose() fails on some PNGs #5509

Closed
doublex opened this issue May 24, 2021 · 4 comments
Closed

PIL.ImageOps.exif_transpose() fails on some PNGs #5509

doublex opened this issue May 24, 2021 · 4 comments

Comments

@doublex
Copy link

doublex commented May 24, 2021

Testcase (extension should be .py):
testcase.txt

Pillow 8.1 works, 8.2 fails

Traceback:

  File "/home/max/.local/lib/python3.8/site-packages/PIL/PngImagePlugin.py", line 940, in load_end
    self.png.call(cid, pos, length)
  File "/home/max/.local/lib/python3.8/site-packages/PIL/PngImagePlugin.py", line 187, in call
    return getattr(self, "chunk_" + cid.decode("ascii"))(pos, length)
AttributeError: 'PngStream' object has no attribute 'chunk_'
@radarhere
Copy link
Member

Just to clarify, the issue doesn't relate to exif_transpose(). It's our generic load() method. Testing, the error started after 22e9bee. So this may not be a bug as much as a security measure.

You probably know, but if you don't enable LOAD_TRUNCATED_IMAGES, then the error doesn't appear.

@radarhere
Copy link
Member

Actually, I've found that this would be fixed by #5493, making this a duplicate of #5491.

@radarhere
Copy link
Member

#5493 has been merged, so this should be fixed in the next version of Pillow. due out on July 1.

@doublex
Copy link
Author

doublex commented Jun 6, 2021

@radarhere
Thank you so much for pillow!

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

No branches or pull requests

2 participants