rmagick 6.1.4 → 6.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 869808111e9ff5a238c87513cf287fccf958b962a0d0a11cef7d7f2e4d66f1a4
4
- data.tar.gz: 781eeaca5f13d2544c41a26faa9c7a7d7a08c8a8615d8982e6ae8ebfef73fee0
3
+ metadata.gz: abd4bb9648eeac55cad07daf192bd139e0310912a97c9511c3a598e87843f586
4
+ data.tar.gz: 37d89abbb4e552c8f8c620cee0f52534c6ed340e27497cb63a438145bb9e9e59
5
5
  SHA512:
6
- metadata.gz: 1e587419ce08959d886d52e1a21648444ef3054f385b8f4aa78cbcd66d37467730555d8ff7e4ba1db753fc98918f65b64b075906dae5a26daf15bdd792a8a589
7
- data.tar.gz: 006f8c9ab91b011cc1a53c588ad4e7e85ecd015efbb3984f154dddff2de030d64209e97a69ce921d053938ffd758351636d42357197076a9be3e19c3d45795ef
6
+ metadata.gz: 0c7f59350e7c28248d76bbdc75546c658ad5dece7c0d5e76fa83bd5dfda6506a511ea11e7573938bb045f8468bd6deb16b0a829bb5ad5e1b4aae25a7381cdbf2
7
+ data.tar.gz: 6575a013a6d86aa063b1825dee76d21b6b9e5948e4b680a860f1857f22026d1af8cdd06d54eae38a48e6aa71062b07e558c6df59eb1d470c95c60f5096ee7453
@@ -4,7 +4,7 @@
4
4
  "dockerfile": "../Dockerfile",
5
5
  "args": {
6
6
  "RUBY_VERSION": "3.3.3",
7
- "IMAGEMAGICK_VERSION": "6.9.13-27"
7
+ "IMAGEMAGICK_VERSION": "6.9.13-33"
8
8
  }
9
9
  },
10
10
  "onCreateCommand": "/setup/setup-repo.sh"
@@ -4,7 +4,7 @@
4
4
  "dockerfile": "Dockerfile",
5
5
  "args": {
6
6
  "RUBY_VERSION": "3.3.3",
7
- "IMAGEMAGICK_VERSION": "7.1.2-1"
7
+ "IMAGEMAGICK_VERSION": "7.1.2-8"
8
8
  }
9
9
  },
10
10
  "onCreateCommand": "/setup/setup-repo.sh"
@@ -15,7 +15,7 @@ jobs:
15
15
  runs-on: ubuntu-latest
16
16
  timeout-minutes: 20
17
17
  steps:
18
- - uses: actions/checkout@v5
18
+ - uses: actions/checkout@v6
19
19
  - name: Set up Ruby 3.3
20
20
  uses: ruby/setup-ruby@master
21
21
  with:
@@ -30,7 +30,7 @@ jobs:
30
30
  name: RBS
31
31
  timeout-minutes: 20
32
32
  steps:
33
- - uses: actions/checkout@v5
33
+ - uses: actions/checkout@v6
34
34
  - name: Set up Ruby 3.0
35
35
  uses: ruby/setup-ruby@master
36
36
  with:
@@ -55,7 +55,7 @@ jobs:
55
55
 
56
56
  name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
57
57
  steps:
58
- - uses: actions/checkout@v5
58
+ - uses: actions/checkout@v6
59
59
  - name: Cache ImageMagick built objects
60
60
  uses: actions/cache@v4
61
61
  with:
@@ -82,14 +82,14 @@ jobs:
82
82
  strategy:
83
83
  fail-fast: false
84
84
  matrix:
85
- ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4']
85
+ ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4', '4.0.0-preview2']
86
86
  imagemagick-version:
87
- - { full: 6.9.13-27, major-minor: '6.9' }
88
- - { full: 7.1.2-1, major-minor: '7.1' }
87
+ - { full: 6.9.13-33, major-minor: '6.9' }
88
+ - { full: 7.1.2-8, major-minor: '7.1' }
89
89
 
90
90
  name: Linux, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
91
91
  steps:
92
- - uses: actions/checkout@v5
92
+ - uses: actions/checkout@v6
93
93
  - name: Cache ImageMagick built objects
94
94
  uses: actions/cache@v4
95
95
  with:
@@ -116,14 +116,14 @@ jobs:
116
116
  strategy:
117
117
  fail-fast: false
118
118
  matrix:
119
- ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4']
119
+ ruby-version: ['3.0', '3.1', '3.2', '3.3', '3.4', '4.0.0-preview2']
120
120
  imagemagick-version:
121
- - { full: 6.9.13-27, major-minor: '6.9' }
122
- - { full: 7.1.2-1, major-minor: '7.1' }
121
+ - { full: 6.9.13-33, major-minor: '6.9' }
122
+ - { full: 7.1.2-8, major-minor: '7.1' }
123
123
 
124
124
  name: macOS, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
125
125
  steps:
126
- - uses: actions/checkout@v5
126
+ - uses: actions/checkout@v6
127
127
  - name: Cache ImageMagick built objects
128
128
  uses: actions/cache@v4
129
129
  with:
@@ -151,14 +151,14 @@ jobs:
151
151
  matrix:
152
152
  ruby-version: ['3.4']
153
153
  imagemagick-version:
154
- - { full: 6.9.13-27, major-minor: '6.9' }
155
- - { full: 7.1.2-1, major-minor: '7.1' }
154
+ - { full: 6.9.13-33, major-minor: '6.9' }
155
+ - { full: 7.1.2-8, major-minor: '7.1' }
156
156
  os:
157
157
  - { target: windows-latest, arch: 'x64' }
158
158
  - { target: windows-11-arm, arch: 'arm64' }
159
159
  exclude:
160
160
  # ImageMagick 6 has not provided ARM binary. Ref. https://legacy.imagemagick.org/archive/binaries/
161
- - imagemagick-version: { full: 6.9.13-27, major-minor: '6.9' }
161
+ - imagemagick-version: { full: 6.9.13-33, major-minor: '6.9' }
162
162
  os: { target: windows-11-arm, arch: 'arm64' }
163
163
 
164
164
  env:
@@ -167,7 +167,7 @@ jobs:
167
167
 
168
168
  name: MSWin ${{ matrix.os.arch }}, Ruby ${{ matrix.ruby-version }}, IM ${{ matrix.imagemagick-version.major-minor }}
169
169
  steps:
170
- - uses: actions/checkout@v5
170
+ - uses: actions/checkout@v6
171
171
  - name: Setup environment variable
172
172
  # https://stackoverflow.com/questions/60169752/how-to-update-the-path-in-a-github-action-workflow-file-for-a-windows-latest-hos
173
173
  run: |
data/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
3
3
  All notable changes to this project are documented in this file.
4
4
  This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
+ ## RMagick 6.1.5
7
+
8
+ Bug Fixes
9
+
10
+ - Fix memory leak in Image#marshal_load (#1721)
11
+ - Fix memory leak in Image::Info#page= (#1720)
12
+ - Fix memory leak in Image::Info#view= with ImageMagick 7 (#1719)
13
+ - Fix memory leak in Image::Info#authenticate= with ImageMagick 7 (#1718)
14
+ - Fix memory leak in Image#marshal_load with invalid data (#1717)
15
+
6
16
  ## RMagick 6.1.4
7
17
 
8
18
  Improvements
data/Gemfile CHANGED
@@ -20,3 +20,5 @@ gem 'rubocop-on-rbs', '~> 1.5' if Gem::Version.new(RUBY_VERSION) >= Gem::Version
20
20
 
21
21
  gem 'rbs', '~> 3.4'
22
22
  gem 'steep', '~> 1.6'
23
+
24
+ gem 'ruby_memcheck', '~> 3.0' if RUBY_PLATFORM.include?('linux')
data/Rakefile CHANGED
@@ -185,6 +185,14 @@ Rake::ExtensionTask.new('RMagick2') do |ext|
185
185
  ext.ext_dir = 'ext/RMagick'
186
186
  end
187
187
 
188
+ if RUBY_PLATFORM.include?('linux')
189
+ require 'ruby_memcheck'
190
+ require 'ruby_memcheck/rspec/rake_task'
191
+ namespace :spec do
192
+ RubyMemcheck::RSpec::RakeTask.new(valgrind: :compile)
193
+ end
194
+ end
195
+
188
196
  task spec: :compile
189
197
 
190
198
  if ENV['STYLE_CHECKS']
@@ -9062,14 +9062,10 @@ Image_marshal_load(VALUE self, VALUE ary)
9062
9062
  {
9063
9063
  VALUE blob, filename;
9064
9064
  Info *info;
9065
- Image *image;
9065
+ Image *image, *new_image;
9066
9066
  ExceptionInfo *exception;
9067
9067
 
9068
- info = CloneImageInfo(NULL);
9069
- if (!info)
9070
- {
9071
- rb_raise(rb_eNoMemError, "not enough memory to initialize Info object");
9072
- }
9068
+ TypedData_Get_Struct(self, Image, &rm_image_data_type, image);
9073
9069
 
9074
9070
  filename = rb_ary_shift(ary);
9075
9071
  blob = rb_ary_shift(ary);
@@ -9077,20 +9073,27 @@ Image_marshal_load(VALUE self, VALUE ary)
9077
9073
  filename = StringValue(filename);
9078
9074
  blob = StringValue(blob);
9079
9075
 
9076
+ info = CloneImageInfo(NULL);
9077
+ if (!info)
9078
+ {
9079
+ rb_raise(rb_eNoMemError, "not enough memory to initialize Info object");
9080
+ }
9081
+
9080
9082
  exception = AcquireExceptionInfo();
9081
9083
  if (filename != Qnil)
9082
9084
  {
9083
9085
  strlcpy(info->filename, RSTRING_PTR(filename), sizeof(info->filename));
9084
9086
  }
9085
9087
  GVL_STRUCT_TYPE(BlobToImage) args = { info, RSTRING_PTR(blob), (size_t)RSTRING_LEN(blob), exception };
9086
- image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(BlobToImage), &args);
9088
+ new_image = (Image *)CALL_FUNC_WITHOUT_GVL(GVL_FUNC(BlobToImage), &args);
9087
9089
 
9088
9090
  // Destroy info before raising an exception
9089
9091
  DestroyImageInfo(info);
9090
9092
  CHECK_EXCEPTION();
9091
9093
  DestroyExceptionInfo(exception);
9092
9094
 
9093
- UPDATE_DATA_PTR(self, image);
9095
+ UPDATE_DATA_PTR(self, new_image);
9096
+ rm_image_destroy(image);
9094
9097
 
9095
9098
  return self;
9096
9099
  }
@@ -446,7 +446,7 @@ Info_authenticate_eq(VALUE self, VALUE passwd_arg)
446
446
  }
447
447
  else
448
448
  {
449
- RemoveImageOption(info, "authenticate");
449
+ DeleteImageOption(info, "authenticate");
450
450
  }
451
451
  #else
452
452
  if (info->authenticate)
@@ -1750,6 +1750,8 @@ Info_page_eq(VALUE self, VALUE page_arg)
1750
1750
  info->page = NULL;
1751
1751
  return page_arg;
1752
1752
  }
1753
+ magick_free(info->page);
1754
+
1753
1755
  info->page = geometry;
1754
1756
 
1755
1757
  RB_GC_GUARD(geom_str);
@@ -2292,7 +2294,7 @@ Info_view_eq(VALUE self, VALUE view_arg)
2292
2294
  }
2293
2295
  else
2294
2296
  {
2295
- RemoveImageOption(info, "fpx:view");
2297
+ DeleteImageOption(info, "fpx:view");
2296
2298
  }
2297
2299
  #else
2298
2300
  if (info->view)
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Magick
4
- VERSION = '6.1.4'
4
+ VERSION = '6.1.5'
5
5
  MIN_RUBY_VERSION = '3.0.0'
6
6
  MIN_IM_VERSION = '6.8.9'
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmagick
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.4
4
+ version: 6.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tim Hunter
@@ -158,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
158
  version: '0'
159
159
  requirements:
160
160
  - ImageMagick 6.8.9 or later
161
- rubygems_version: 3.6.9
161
+ rubygems_version: 4.0.3
162
162
  specification_version: 4
163
163
  summary: Ruby binding to ImageMagick
164
164
  test_files: []