From 5f0e651edea3139b5fbc27cc4c0cc4a3cba773b5 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 9 Nov 2008 15:54:21 +0100 Subject: [PATCH] image: check image width and height Signed-off-by: Julien Danjou --- image.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/image.c b/image.c index 23133289d..8428257fe 100644 --- a/image.c +++ b/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;