Commit 794bba8f authored by Ryan C. Gordon's avatar Ryan C. Gordon

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

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40718
parent f41ebcb4
...@@ -277,6 +277,11 @@ static void handle_mouse(const int numevents, DIDEVICEOBJECTDATA *ptrbuf) ...@@ -277,6 +277,11 @@ static void handle_mouse(const int numevents, DIDEVICEOBJECTDATA *ptrbuf)
Uint8 button; Uint8 button;
DWORD timestamp = 0; 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 we are in windowed mode, Windows is taking care of the mouse */
if ( (SDL_PublicSurface->flags & SDL_OPENGL) || if ( (SDL_PublicSurface->flags & SDL_OPENGL) ||
!(SDL_PublicSurface->flags & SDL_FULLSCREEN) ) { !(SDL_PublicSurface->flags & SDL_FULLSCREEN) ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment