mirror of
https://github.com/love2d/love.git
synced 2026-08-21 13:09:56 +02:00
Apply box2d heap tickler patch: make sure ChainShape:getPoints has enough stack size
This commit is contained in:
@@ -92,6 +92,8 @@ int w_ChainShape_getPoints(lua_State *L)
|
|||||||
ChainShape *c = luax_checkchainshape(L, 1);
|
ChainShape *c = luax_checkchainshape(L, 1);
|
||||||
const b2Vec2 *verts = c->getPoints();
|
const b2Vec2 *verts = c->getPoints();
|
||||||
int count = c->getVertexCount();
|
int count = c->getVertexCount();
|
||||||
|
if (!lua_checkstack(L, count*2))
|
||||||
|
return luaL_error(L, "Too many return values");
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
b2Vec2 v = Physics::scaleUp(verts[i]);
|
b2Vec2 v = Physics::scaleUp(verts[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user