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

Use mmap instead of built-in Win32 mapper #5224

Merged
merged 4 commits into from
Mar 7, 2021

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Jan 25, 2021

Resolves #5221, as reported by the user who created that issue.

Recreated version of #4310, since it needed to be rebased and the Pillow repository from @cgohlke has disappeared.

@raygard
Copy link
Contributor

raygard commented Jan 26, 2021

See https://gist.github.com/raygard/3615f737e448ba1bf7a45874772db1c7 for a test. I don't know how this needs to be set up for CI testing, etc. But it does demonstrate the before/after behavior you need.

@radarhere
Copy link
Member Author

I have added a test, using the initial comment in #5221

By itself, this test causes a 'Windows fatal exception: access violation'.

With the change from this PR, it passes.

@hugovk hugovk merged commit f15f573 into python-pillow:master Mar 7, 2021
@hugovk
Copy link
Member

hugovk commented Mar 7, 2021

Thanks all!

@radarhere radarhere deleted the mapper branch March 7, 2021 21:02
@radarhere radarhere changed the title Do not use "use built-in mapper WIN32 only" Use mmap instead of built-in Win32 mapper Mar 8, 2021
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.

Win32: map.c integer overflow crashes PIL in tobytes()
3 participants