changeset 4921:40a43c6d9220

Fixed crash if the gesture coordinates go negative - FIXME: Should this protection be at a lower level?
author Sam Lantinga <slouken@libsdl.org>
date Tue, 30 Nov 2010 18:08:01 -0800
parents a4032241deb5
children ba79f17d68c1
files test/testgesture.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/testgesture.c	Tue Nov 30 18:07:31 2010 -0800
+++ b/test/testgesture.c	Tue Nov 30 18:08:01 2010 -0800
@@ -81,8 +81,8 @@
   int y = (int)_y;
   float a;
   
-  if(x > screen->w) return;
-  if(y > screen->h) return;
+  if(x < 0 || x > screen->w) return;
+  if(y < 0 || y > screen->h) return;
 
   pixmem32 = (Uint32*) screen->pixels  + y*screen->pitch/BPP + x;