From 9f84f624d3a6be89804a55ddea878f4cdaca6e77 Mon Sep 17 00:00:00 2001 From: scuri Date: Fri, 25 Sep 2009 18:40:30 +0000 Subject: *** empty log message *** --- src/lua5/imlua_image.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lua5') 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 @@ -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; } -- cgit v1.2.3