Skip to content

Commit

Permalink
Date: Sun, 14 Sep 2003 17:04:55 -0400
Browse files Browse the repository at this point in the history
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 3216d73
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/video/windx5/SDL_dx5events.c
Expand Up @@ -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) ) {
Expand Down

0 comments on commit 3216d73

Please sign in to comment.