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

WebP: Fix memory leak during decoding on failure #5798

Merged
merged 1 commit into from Dec 5, 2021

Conversation

ilai-deutel
Copy link
Contributor

@ilai-deutel ilai-deutel commented Oct 28, 2021

When creating the WebPAnimDecoder object, we create a WebPAnimDecoderObject and populate its data using WebPDataCopy().

Subsequently, if either WebPAnimDecoderNew() or WebPAnimDecoderGetInfo() fails, data is not currently deallocated, which may cause memory leaks.

This PR clears the decoder object's data in that situation.

When creating the `WebPAnimDecoder` object, we create a `WebPAnimDecoderObject` and populate its data using `WebPDataCopy()`.

Subsequently, if either `WebPAnimDecoderNew()` or `WebPAnimDecoderGetInfo()` fails, data is not currently deallocated. This commit clears the decoder object's data in that situation.
@radarhere
Copy link
Member

@radarhere radarhere commented Dec 5, 2021

Thanks

@radarhere radarhere merged commit 06372b5 into python-pillow:main Dec 5, 2021
49 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants