Fixed a potential null pointer dereference and a case of undefined behaviour

This commit is contained in:
Alex Szpakowski
2014-04-11 03:48:12 -03:00
parent b98e6add18
commit f05551a01f
3 changed files with 5 additions and 2 deletions
@@ -147,6 +147,9 @@ int w_Mesh_getVertices(lua_State *L)
size_t count = t->getVertexCount();
lua_createtable(L, count, 0);
if (count == 0 || vertices == nullptr)
return 1;
for (size_t i = 0; i < count; i++)
{
// Create vertex table.