sizeof(unsigned char)

This commit is contained in:
LBPHacker 2016-12-04 16:23:50 +01:00 committed by jacob1
parent 5cf3fa3f5b
commit e9d80fe52a

View File

@ -1982,7 +1982,7 @@ int LuaScriptInterface::simulation_brush(lua_State * l)
lua_pushnumber(l, sizeY); lua_pushnumber(l, sizeY);
lua_pushnumber(l, 0); lua_pushnumber(l, 0);
lua_pushnumber(l, 0); lua_pushnumber(l, 0);
int bitmapSize = sizeX * sizeY; int bitmapSize = sizeX * sizeY * sizeof(unsigned char);
void *bitmapCopy = lua_newuserdata(l, bitmapSize); void *bitmapCopy = lua_newuserdata(l, bitmapSize);
memcpy(bitmapCopy, brushList[brushID]->GetBitmap(), bitmapSize); memcpy(bitmapCopy, brushList[brushID]->GetBitmap(), bitmapSize);
brushList[brushID]->SetRadius(tempRadius); brushList[brushID]->SetRadius(tempRadius);