From cb1efac715ea43bd9cd497c35ce42d803eda19d9 Mon Sep 17 00:00:00 2001 From: Bart van Strien Date: Tue, 7 Dec 2010 19:52:35 +0100 Subject: [PATCH] Wrappers now catch negative width or height in setScissor (bug #125) --- src/modules/graphics/opengl/wrap_Graphics.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 2d4986bd3..9e1cdf0d9 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -133,6 +133,9 @@ namespace opengl int w = luaL_checkint(L, 3); int h = luaL_checkint(L, 4); + if (w < 0 || h < 0) + return luaL_error(L, "Can't set scissor with negative width and/or height."); + instance->setScissor(x, y, w, h); return 0; }