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

#3 Sigegv fix #4

Merged
merged 1 commit into from
May 8, 2020
Merged

#3 Sigegv fix #4

merged 1 commit into from
May 8, 2020

Conversation

Firstmol
Copy link

@Firstmol Firstmol commented May 7, 2020

No description provided.

@ediweissmann ediweissmann merged commit 9699326 into sejda-pdf:master May 8, 2020
ediweissmann added a commit that referenced this pull request May 27, 2020
} else {
byte[] rgbData = getRGB(aImage);
return WebP.encodeRGB(aOptions, rgbData, aImage.getWidth(), aImage.getHeight(), aImage.getWidth() * 3);
ThreadLocal<WebPEncoderOptions> encoderThreadLocal = new ThreadLocal<>();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is ThreadLocal here preferred over any other reference-holding container, e.g. a WebPEncoderOptions[] ?

And wouldn't calling an aOptions.noopForAvoidingGC() method in the finally block have the same effect, since it prevents removing the object until then? This would spare us creating the extra container object.

@pbi-qfs pbi-qfs mentioned this pull request Sep 2, 2020
joostoudeman pushed a commit to joostoudeman/webp-imageio that referenced this pull request Jun 16, 2023
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.

3 participants