Commit dc22c27a authored by Sam Lantinga's avatar Sam Lantinga

Fixed crash if the gesture coordinates go negative - FIXME: Should this...

Fixed crash if the gesture coordinates go negative - FIXME: Should this protection be at a lower level?
parent 3d9620ed
...@@ -81,8 +81,8 @@ void setpix(SDL_Surface *screen, float _x, float _y, unsigned int col) ...@@ -81,8 +81,8 @@ void setpix(SDL_Surface *screen, float _x, float _y, unsigned int col)
int y = (int)_y; int y = (int)_y;
float a; float a;
if(x > screen->w) return; if(x < 0 || x > screen->w) return;
if(y > screen->h) return; if(y < 0 || y > screen->h) return;
pixmem32 = (Uint32*) screen->pixels + y*screen->pitch/BPP + x; pixmem32 = (Uint32*) screen->pixels + y*screen->pitch/BPP + x;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment