# HG changeset patch # User Sam Lantinga # Date 995486898 0 # Node ID e21ac1dd30f1877bcaf7463bf66d0ed5c6dd28a8 # Parent 9ef74357a5fb45fba1cd6b4809489ad1aee62fe8 Fixed crash if mouse is outside of the screen bounds for some reason diff -r 9ef74357a5fb -r e21ac1dd30f1 src/video/SDL_cursor.c --- a/src/video/SDL_cursor.c Wed Jul 18 20:04:23 2001 +0000 +++ b/src/video/SDL_cursor.c Wed Jul 18 20:08:18 2001 +0000 @@ -348,11 +348,11 @@ } clip_diff = (area->x+area->w)-SDL_VideoSurface->w; if ( clip_diff > 0 ) { - area->w -= clip_diff; + area->w = area->w < clip_diff ? 0 : area->w-clip_diff; } clip_diff = (area->y+area->h)-SDL_VideoSurface->h; if ( clip_diff > 0 ) { - area->h -= clip_diff; + area->h = area->h < clip_diff ? 0 : area->h-clip_diff; } }