Skip to content

Allow arbitrary number of comment extension subblocks - #3479

Merged
hugovk merged 2 commits into
python-pillow:masterfrom
radarhere:gif_extension
Dec 4, 2018
Merged

hugovk merged 2 commits into
python-pillow:masterfrom
radarhere:gif_extension

Conversation

@radarhere

@radarhere radarhere commented Nov 27, 2018 •

Copy link
Copy Markdown
Member

Resolves #1718

#1718 features a GIF with a comment extension block. The specification - https://www.w3.org/Graphics/GIF/spec-gif89a.txt - says that the contents of this block are a ‘Sequence of sub-blocks’. The image from the issue has a sequence of zero sub-blocks. I have added a test image that also has zero subblocks in a comment extension block. It produces a different error, but with the same cause - GifImagePlugin has been skipping forward, looking for the block to terminate, when the terminator was mistakenly read as the subblock contents.

This PR also allows for more than one subblock, meaning that GIF comments can now be longer than 255 characters.

@radarhere radarhere added the GIF label Nov 27, 2018
@hugovk
hugovk merged commit a4fccd3 into python-pillow:master Dec 4, 2018
@radarhere
radarhere deleted the gif_extension branch December 4, 2018 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants