mirror of https://github.com/bjornbytes/lovr.git
Pass:line copies tables of vectors to vertices better;
Using vec3_init writes 4 floats which can, extremely rarely, go past the end of the vertex buffer.
This commit is contained in:
parent
7bd3546aa9
commit
bb46fa5745
|
@ -558,9 +558,10 @@ static void luax_readvertices(lua_State* L, int index, float* vertices, uint32_t
|
|||
} else if (innerType == LUA_TUSERDATA || innerType == LUA_TLIGHTUSERDATA) {
|
||||
for (uint32_t i = 0; i < count; i++) {
|
||||
lua_rawgeti(L, index, i + 1);
|
||||
vec3_init(vertices, luax_checkvector(L, -1, V_VEC3, NULL));
|
||||
lua_pop(L, 1);
|
||||
float* v = luax_checkvector(L, -1, V_VEC3, NULL);
|
||||
memcpy(vertices, v, 3 * sizeof(float));
|
||||
vertices += 3;
|
||||
lua_pop(L, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue