]> git.imager.perl.org - imager.git/commitdiff
gradgen allocated sizeof(i_color *) per entry rather than sizeof(i_color)
authorTony Cook <tony@develop-help.com>
Wed, 2 Jan 2019 07:39:28 +0000 (18:39 +1100)
committerTony Cook <tony@develop-help.com>
Wed, 2 Jan 2019 07:39:28 +0000 (18:39 +1100)
i_color is four bytes, so this is safe on any arch I've used.

Changes
Imager.xs

diff --git a/Changes b/Changes
index 2d6f454b2918dcd1685e576daa2f8d1aacdbd556..02bb4040a36a80fca6e87984f0c66a6feab50d9a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -61,6 +61,9 @@ High severity:
  - avoid accessing a possibly NULL map from MakeMapObject() in a
    logging call. (GIF) CID 185296.
 
+ - gradgen() allocated the wrong amount of space (always too much) for
+   the color array.  CID 185291.
+
 Imager 1.008 - 31 Dec 2018
 ============
 
index dffe2d297e549f4d48b590bdb588538773aa126d..e184078a5861c8668180d306b5fcc2505a4f7222 100644 (file)
--- a/Imager.xs
+++ b/Imager.xs
@@ -141,7 +141,7 @@ calloc_temp(pTHX_ size_t size) {
 #define i_img_dimPtr(size) ((i_img_dim *)calloc_temp(aTHX_ sizeof(i_img_dim) * (size)))
 #define SvI_img_dim(sv, pname) (SvIV(sv))
 
-#define i_colorPtr(size) ((i_color *)calloc_temp(aTHX_ sizeof(i_color *) * (size)))
+#define i_colorPtr(size) ((i_color *)calloc_temp(aTHX_ sizeof(i_color) * (size)))
 
 #define SvI_color(sv, pname) S_sv_to_i_color(aTHX_ sv, pname)