mirror of
https://github.com/love2d/love.git
synced 2026-08-12 00:20:52 +02:00
don't allow invalid types for the second param of readbackTexture.
This commit is contained in:
@@ -2395,6 +2395,8 @@ int w_readbackTexture(lua_State *L)
|
||||
int slice = 0;
|
||||
if (t->getTextureType() != TEXTURE_2D)
|
||||
slice = (int) luaL_checkinteger(L, 2) - 1;
|
||||
else if (!lua_isnoneornil(L, 2) && lua_type(L, 2) != LUA_TNUMBER)
|
||||
luaL_argerror(L, 2, "number or nil expected");
|
||||
|
||||
int mipmap = (int) luaL_optinteger(L, 3, 1) - 1;
|
||||
|
||||
@@ -2433,6 +2435,8 @@ int w_readbackTextureAsync(lua_State *L)
|
||||
int slice = 0;
|
||||
if (t->getTextureType() != TEXTURE_2D)
|
||||
slice = (int) luaL_checkinteger(L, 2) - 1;
|
||||
else if (!lua_isnoneornil(L, 2) && lua_type(L, 2) != LUA_TNUMBER)
|
||||
luaL_argerror(L, 2, "number or nil expected");
|
||||
|
||||
int mipmap = (int) luaL_optinteger(L, 3, 1) - 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user