summaryrefslogtreecommitdiff
path: root/src/lua5/imlua_image.c
diff options
context:
space:
mode:
authorscuri <scuri>2009-09-25 18:40:30 +0000
committerscuri <scuri>2009-09-25 18:40:30 +0000
commit9f84f624d3a6be89804a55ddea878f4cdaca6e77 (patch)
tree0872bd951622453ed761f14fe7b03d76c4eda567 /src/lua5/imlua_image.c
parent5ba44ee397f7524ed6808a62f0bdb8ebc7f0045b (diff)
*** empty log message ***
Diffstat (limited to 'src/lua5/imlua_image.c')
-rw-r--r--src/lua5/imlua_image.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lua5/imlua_image.c b/src/lua5/imlua_image.c
index 6d5ea2b..40b1e9c 100644
--- a/src/lua5/imlua_image.c
+++ b/src/lua5/imlua_image.c
@@ -2,7 +2,7 @@
* \brief IM Lua 5 Binding
*
* See Copyright Notice in im_lib.h
- * $Id: imlua_image.c,v 1.4 2009/08/19 21:33:55 scuri Exp $
+ * $Id: imlua_image.c,v 1.5 2009/09/25 18:40:31 scuri Exp $
*/
#include <string.h>
@@ -479,7 +479,9 @@ static int imluaImageSetPalette (lua_State *L)
{
imImage *image = imlua_checkimage(L, 1);
imluaPalette *pal = imlua_checkpalette(L, 2);
- imImageSetPalette(image, pal->color, pal->count);
+ long* palette = (long*)malloc(sizeof(long)*256);
+ memcpy(palette, pal->color, pal->count*sizeof(long));
+ imImageSetPalette(image, palette, pal->count);
return 0;
}