]> git.imager.perl.org - imager.git/commitdiff
fix i_nearest_color() for threaded builds
authorTony Cook <tony@develop-help.com>
Wed, 9 Mar 2016 09:59:03 +0000 (20:59 +1100)
committerTony Cook <tony@develop-help.com>
Wed, 9 Mar 2016 09:59:03 +0000 (20:59 +1100)
Imager.xs

index b8bfde82db0c8861f93d68c10f12d879fe27e905..85f62248f1520d8e0429337e60fca317eb9b70f9 100644 (file)
--- a/Imager.xs
+++ b/Imager.xs
@@ -3047,9 +3047,9 @@ i_nearest_color(im, ...)
        num = num <= av_len(ac) ? num : av_len(ac);
        num++; 
        if (num < 2) croak("Usage: i_nearest_color array refs must have more than 1 entry each");
        num = num <= av_len(ac) ? num : av_len(ac);
        num++; 
        if (num < 2) croak("Usage: i_nearest_color array refs must have more than 1 entry each");
-       xo = malloc_temp( sizeof(i_img_dim) * num );
-       yo = malloc_temp( sizeof(i_img_dim) * num );
-       ival = malloc_temp( sizeof(i_color) * num );
+       xo = malloc_temp(aTHX_ sizeof(i_img_dim) * num );
+       yo = malloc_temp(aTHX_ sizeof(i_img_dim) * num );
+       ival = malloc_temp(aTHX_ sizeof(i_color) * num );
        for(i = 0; i<num; i++) {
          xo[i]   = (i_img_dim)SvIV(* av_fetch(axx, i, 0));
          yo[i]   = (i_img_dim)SvIV(* av_fetch(ayy, i, 0));
        for(i = 0; i<num; i++) {
          xo[i]   = (i_img_dim)SvIV(* av_fetch(axx, i, 0));
          yo[i]   = (i_img_dim)SvIV(* av_fetch(ayy, i, 0));