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

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

Thanks

@radarhere radarhere merged commit 06372b5 into python-pillow:main Dec 5, 2021
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