Skip to content

Corrected negative seeks#4101

Merged
radarhere merged 1 commit intopython-pillow:masterfrom
radarhere:negative_seek
Sep 30, 2019
Merged

Corrected negative seeks#4101
radarhere merged 1 commit intopython-pillow:masterfrom
radarhere:negative_seek

Conversation

@radarhere
Copy link
Copy Markdown
Member

@radarhere radarhere commented Sep 30, 2019

In RawDecode.c, throw an error if skip is calculated to be less than zero. It is intended to skip padding between lines, not to go backwards.

Unrelated to that, but with the same idea, in PsdImagePlugin, if the combined sizes of the individual parts is larger than the declared size of the extra data field, then it looks for the next layer by seeking backwards. This is corrected by seeking to (the start of the layer + the size of the extra data field) instead of (the read parts of the layer + the rest of the layer).

@radarhere radarhere merged commit b36c1bc into python-pillow:master Sep 30, 2019
@radarhere radarhere deleted the negative_seek branch September 30, 2019 09:30
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.

1 participant