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

Fix memory leak in Magick::Draw for recentry ImageMagick 6 by removing unnecessary GetDrawInfo() calling #1406

Merged
merged 1 commit into from Jul 16, 2023

Conversation

Watson1978
Copy link
Member

Fix #1401

Before After

Test code

require 'rmagick'

3000.times do |i|
  img = Magick::Image.new(1000, 1000)

  gc = Magick::Draw.new
  gc.text(0, 67, 'Hello world!!')
  gc.draw(img)
end

Copy link
Member

@dlemstra dlemstra left a comment

Choose a reason for hiding this comment

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

This is the correct patch because AcquireDrawInfo already calls GetDrawInfo.

@Watson1978
Copy link
Member Author

Thanks!

@Watson1978 Watson1978 merged commit fec7a7e into rmagick:main Jul 16, 2023
58 checks passed
@Watson1978 Watson1978 deleted the GetDrawInfo branch July 16, 2023 10:26
Watson1978 added a commit to Watson1978/gruff that referenced this pull request Jul 19, 2023
Watson1978 added a commit to topfunky/gruff that referenced this pull request Jul 19, 2023
@bastien-roucaries
Copy link

Asked for a CVE

@bastien-roucaries
Copy link

Will give you the number ASAP

@carnil
Copy link

carnil commented Oct 22, 2023

For reference it is CVE-2023-5349.

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.

Huge memory consumption with latest imagemagick@6 update
4 participants