From 00dae1dc99bd0d2eee2c6be250f29fc416498fad Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Tue, 30 Nov 2010 18:08:01 -0800 Subject: [PATCH] Fixed crash if the gesture coordinates go negative - FIXME: Should this protection be at a lower level? --- test/testgesture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testgesture.c b/test/testgesture.c index 69ef17b33..0667c539e 100644 --- a/test/testgesture.c +++ b/test/testgesture.c @@ -81,8 +81,8 @@ void setpix(SDL_Surface *screen, float _x, float _y, unsigned int col) 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;