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

Handle multiple and malformed JPEG APP13 markers #4370

Merged
merged 5 commits into from Jan 27, 2020

Conversation

homm
Copy link
Member

@homm homm commented Jan 19, 2020

This is a regression compared to Pillow 5.3, where the APP13 marker was not analyzing and images were opening without errors.

I met JPEGs with two APP13 markers were the first APP13 is always 65504 bytes length and looks like the second is just a continuation.

One of them: https://user-images.githubusercontent.com/128982/72672639-0a30b800-3a6e-11ea-88c2-d2b8fa8ca623.jpeg

This fix does not join markers since I don't know is it applicable for all files. Instead, it does not fail on the reading errors and collects data from all successfully processed markers.

@homm homm requested a review from radarhere January 19, 2020 00:54
@radarhere
Copy link
Member

radarhere commented Jan 20, 2020

Is the image that you've linked to one that can be included as a test image under the Pillow license?

@homm
Copy link
Member Author

homm commented Jan 20, 2020

Probably no. I'll prepare another image with the same chunks.

@homm homm removed the Needs Tests label Jan 20, 2020
@homm
Copy link
Member Author

homm commented Jan 20, 2020

@radarhere Test added

Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com>
@homm homm merged commit 5965437 into python-pillow:master Jan 27, 2020
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.

None yet

2 participants