comparison src/video/windx5/SDL_dx5events.c @ 717:42ed44b2c8b6

Date: Sun, 14 Sep 2003 17:04:55 -0400 From: Philip D.S. Thoren <pthoren@cs.uml.edu> Reply-To: "sdl@libsdl.org" <sdl@libsdl.org> To: "sdl@libsdl.org" <sdl@libsdl.org> Subject: [SDL] BUG in src/video/windx5/SDL_dx5events.c I tracked down a bug that crashed my program on Windows *all* the time. FILE: src/video/windx5/SDL_dx5events.c FUNCTION: handle_mouse BUG: SDL_PublicSurface is being dereferenced when it is NULL. I added the following to the very begining of handle_mouse and it solved my crashing problems: if (SDL_PublicSurface == NULL) return; ~ Philip D.S. Thoren
author Ryan C. Gordon <icculus@icculus.org>
date Mon, 15 Sep 2003 13:51:25 +0000
parents bf7f477fb2b2
children ab0656314eef
comparison
equal deleted inserted replaced
716:f25e3334d583 717:42ed44b2c8b6
274 int i; 274 int i;
275 Sint16 xrel, yrel; 275 Sint16 xrel, yrel;
276 Uint8 state; 276 Uint8 state;
277 Uint8 button; 277 Uint8 button;
278 DWORD timestamp = 0; 278 DWORD timestamp = 0;
279
280 /* Sanity check. Mailing list reports this being NULL unexpectedly. */
281 if (SDL_PublicSurface == NULL) {
282 return;
283 }
279 284
280 /* If we are in windowed mode, Windows is taking care of the mouse */ 285 /* If we are in windowed mode, Windows is taking care of the mouse */
281 if ( (SDL_PublicSurface->flags & SDL_OPENGL) || 286 if ( (SDL_PublicSurface->flags & SDL_OPENGL) ||
282 !(SDL_PublicSurface->flags & SDL_FULLSCREEN) ) { 287 !(SDL_PublicSurface->flags & SDL_FULLSCREEN) ) {
283 return; 288 return;