Fix Mesh:setVertices starting index wraparound crash;

This commit is contained in:
bjorn 2021-10-09 03:01:40 -07:00
parent 6b99862d3d
commit fe08dc3769
1 changed files with 1 additions and 0 deletions

View File

@ -292,6 +292,7 @@ static int l_lovrMeshSetVertices(lua_State* L) {
uint32_t capacity = lovrMeshGetVertexCount(mesh);
uint32_t start = luaL_optinteger(L, 3, 1) - 1;
lovrAssert(start < capacity, "Starting vertex index must be in range [1, %d]", capacity);
uint32_t count = luaL_optinteger(L, 4, capacity - start);
size_t stride = firstAttribute->stride;