Handle multiple and malformed JPEG APP13 markers#4370
Merged
homm merged 5 commits intopython-pillow:masterfrom Jan 27, 2020
Merged
Handle multiple and malformed JPEG APP13 markers#4370homm merged 5 commits intopython-pillow:masterfrom
homm merged 5 commits intopython-pillow:masterfrom
Conversation
27e151c to
dcd0cd9
Compare
Member
|
Is the image that you've linked to one that can be included as a test image under the Pillow license? |
Member
Author
|
Probably no. I'll prepare another image with the same chunks. |
Member
Author
|
@radarhere Test added |
radarhere
reviewed
Jan 27, 2020
radarhere
approved these changes
Jan 27, 2020
Co-Authored-By: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.