# HG changeset patch # User Sam Lantinga # Date 1044596835 0 # Node ID 591b438ab94ac5622a2fde2f0c93ceef992f3a3f # Parent a71ce390adeb7ff03914c3c88806126349bb8b72 Don't warp the mouse when a video mode hasn't been set diff -r a71ce390adeb -r 591b438ab94a src/video/SDL_cursor.c --- a/src/video/SDL_cursor.c Tue Feb 04 21:05:20 2003 +0000 +++ b/src/video/SDL_cursor.c Fri Feb 07 05:47:15 2003 +0000 @@ -295,6 +295,11 @@ SDL_VideoDevice *video = current_video; SDL_VideoDevice *this = current_video; + if ( !video || !SDL_PublicSurface ) { + SDL_SetError("A video mode must be set before warping mouse"); + return; + } + /* If we have an offset video mode, offset the mouse coordinates */ x += (this->screen->offset % this->screen->pitch) / this->screen->format->BytesPerPixel;