Static analysis fix: dereference of a NULL pointer.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 20 Mar 2014 11:22:57 -0400
changeset 86528514fc57f124
parent 8651 b1cb565609dc
child 8653 b50c61457c91
Static analysis fix: dereference of a NULL pointer.
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Thu Mar 20 11:14:02 2014 -0400
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Thu Mar 20 11:22:57 2014 -0400
     1.3 @@ -1464,9 +1464,7 @@
     1.4          CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
     1.5      }
     1.6  
     1.7 -    if ( window->flags & SDL_WINDOW_FULLSCREEN ) {
     1.8 -        SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
     1.9 -
    1.10 +    if ( data && (window->flags & SDL_WINDOW_FULLSCREEN) ) {
    1.11          if (SDL_ShouldAllowTopmost() && (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
    1.12              /* OpenGL is rendering to the window, so make it visible! */
    1.13              [data->nswindow setLevel:CGShieldingWindowLevel()];