[DRE-commits] [ruby-rmagick] 03/15: Allocate DrawInfo using the ImageMagick APi

Antonio Terceiro terceiro at moszumanska.debian.org
Sun Dec 4 15:33:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository ruby-rmagick.

commit 9f7d7d49b4df4fbeaea95fb6f5e4f4d7dd8ef0e3
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sat Dec 3 16:14:22 2016 -0200

    Allocate DrawInfo using the ImageMagick APi
    
    Closes: #591419
---
 debian/changelog                                   |  3 ++
 ...locate-DrawInfo-using-the-ImageMagick-API.patch | 32 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 36 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index f79dd45..02a8f50 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,9 @@
 ruby-rmagick (2.16.0-1) UNRELEASED; urgency=medium
 
   * New upstream version 2.16.0
+  * debian/patches/0005-Allocate-DrawInfo-using-the-ImageMagick-API.patch:
+    use ImageMagick API to allocate memory for DrawInfo struct, which is
+    supposed to be opaque (Closes: #591419)
 
  -- Antonio Terceiro <terceiro at debian.org>  Sat, 03 Dec 2016 10:26:54 -0200
 
diff --git a/debian/patches/0005-Allocate-DrawInfo-using-the-ImageMagick-API.patch b/debian/patches/0005-Allocate-DrawInfo-using-the-ImageMagick-API.patch
new file mode 100644
index 0000000..efb14ce
--- /dev/null
+++ b/debian/patches/0005-Allocate-DrawInfo-using-the-ImageMagick-API.patch
@@ -0,0 +1,32 @@
+From: Antonio Terceiro <terceiro at debian.org>
+Date: Sat, 3 Dec 2016 16:02:40 -0200
+Subject: Allocate DrawInfo using the ImageMagick API
+
+DrawInfo is supposed to be a opaque struct; RMagick should not need to
+know which size it is.
+---
+ ext/RMagick/rmdraw.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ext/RMagick/rmdraw.c b/ext/RMagick/rmdraw.c
+index cf2171e..99054da 100644
+--- a/ext/RMagick/rmdraw.c
++++ b/ext/RMagick/rmdraw.c
+@@ -670,7 +670,7 @@ Draw_marshal_load(VALUE self, VALUE ddraw)
+ 
+     Data_Get_Struct(self, Draw, draw);
+ 
+-    draw->info = magick_malloc(sizeof(DrawInfo));
++    draw->info = AcquireDrawInfo();
+     if (!draw->info)
+     {
+         rb_raise(rb_eNoMemError, "not enough memory to continue");
+@@ -1727,7 +1727,7 @@ DrawOptions_initialize(VALUE self)
+     Draw *draw_options;
+ 
+     Data_Get_Struct(self, Draw, draw_options);
+-    draw_options->info = magick_malloc(sizeof(DrawInfo));
++    draw_options->info = AcquireDrawInfo();
+     if (!draw_options->info)
+     {
+         rb_raise(rb_eNoMemError, "not enough memory to continue");
diff --git a/debian/patches/series b/debian/patches/series
index b36d194..0f49c4a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 0002-Ignore-removed-srgb.icm-file-in-tests.patch
 0003-Use-deterministic-label-for-image.patch
 0004-Seed-RNG-to-0-during-builds.patch
+0005-Allocate-DrawInfo-using-the-ImageMagick-API.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-rmagick.git



More information about the Pkg-ruby-extras-commits mailing list