summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2004-05-24 23:18:59 +0000
committerpixel <pixel>2004-05-24 23:18:59 +0000
commit734f17aa8fc62e4e49104b35064df7c7619bee89 (patch)
treed4510b7fe46672106f00859de6d69b10e0e2e816 /lib
parent5b1e50428eab9ea1d141b84e4579d77ac7b8f2d9 (diff)
Invalid cropping
Diffstat (limited to 'lib')
-rw-r--r--lib/luapsx.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/luapsx.cpp b/lib/luapsx.cpp
index 68cfd3e..0eb1b40 100644
--- a/lib/luapsx.cpp
+++ b/lib/luapsx.cpp
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-/* $Id: luapsx.cpp,v 1.3 2004-04-27 17:52:15 pixel Exp $ */
+/* $Id: luapsx.cpp,v 1.4 2004-05-24 23:18:59 pixel Exp $ */
#include <LuaHandle.h>
#include "luapsx.h"
@@ -238,9 +238,21 @@ int sLua_psx::psx_proceed_statics(Lua * L, int n, int caller) {
return 0;
}
+ if ((sx + sw) < 0)
+ return;
+
+ if (sx >= dw)
+ return;
+
+ if ((sy + sh) < 0)
+ return;
+
+ if (sy >= dh)
+ return;
+
if (sy < 0) {
- sstart += sw * bytes * sy;
- sh -= sy;
+ sstart -= sw * bytes * sy;
+ sh += sy;
sy = 0;
} else {
dstart += dw * 3 * sy;
@@ -251,9 +263,9 @@ int sLua_psx::psx_proceed_statics(Lua * L, int n, int caller) {
}
if (sx < 0) {
- sstart += sx * bytes;
- sskip += sx * bytes;
- sw -= sx;
+ sstart -= sx * bytes;
+ sskip -= sx * bytes;
+ sw += sx;
sx = 0;
} else {
dstart += sx * 3;