- [FIX] overflow in setpal
This commit is contained in:
2
lua.cpp
2
lua.cpp
@@ -80,7 +80,7 @@ extern "C" {
|
|||||||
int r,g,b;
|
int r,g,b;
|
||||||
if (lua_istable(L, -1)) {
|
if (lua_istable(L, -1)) {
|
||||||
uint32_t pal[256];
|
uint32_t pal[256];
|
||||||
const int len = lua_rawlen(L, -1);
|
const int len = SDL_min(256, lua_rawlen(L, -1));
|
||||||
for (int i=1;i<=len;++i) {
|
for (int i=1;i<=len;++i) {
|
||||||
lua_rawgeti(L, -1, i);
|
lua_rawgeti(L, -1, i);
|
||||||
lua_getfield(L, -1, "r");
|
lua_getfield(L, -1, "r");
|
||||||
|
|||||||
Reference in New Issue
Block a user