Skip to content
Permalink
Browse files

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
  • Loading branch information
icculus committed Sep 15, 2003
1 parent 689ec1f commit 3216d73806f6c577c2ab968eb5106ad803fbe183
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/video/windx5/SDL_dx5events.c
@@ -277,6 +277,11 @@ static void handle_mouse(const int numevents, DIDEVICEOBJECTDATA *ptrbuf)
Uint8 button;
DWORD timestamp = 0;

/* Sanity check. Mailing list reports this being NULL unexpectedly. */
if (SDL_PublicSurface == NULL) {
return;
}

/* If we are in windowed mode, Windows is taking care of the mouse */
if ( (SDL_PublicSurface->flags & SDL_OPENGL) ||
!(SDL_PublicSurface->flags & SDL_FULLSCREEN) ) {

0 comments on commit 3216d73

Please sign in to comment.