image: check image width and height
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
7108e5cb20
commit
5f0e651ede
4
image.c
4
image.c
|
@ -176,6 +176,10 @@ luaA_image_new(lua_State *L)
|
|||
{
|
||||
int width = luaL_checknumber(L, 3);
|
||||
int height = luaL_checknumber(L, 4);
|
||||
|
||||
if(width <= 0 || height <= 0)
|
||||
luaL_error(L, "request image has invalid size");
|
||||
|
||||
Imlib_Image imimage = imlib_create_image(width, height);
|
||||
image_t *image = p_new(image_t, 1);
|
||||
image->image = imimage;
|
||||
|
|
Loading…
Reference in New Issue