• Ryan C. Gordon's avatar
    Patch by me to fix crash described below. · 351fcc95
    Ryan C. Gordon authored
    --ryan.
    
    
    
    To: sdl@libsdl.org
    From: Rainer Deyke <rainerd@eldwood.com>
    Date: Tue, 16 Aug 2005 01:08:18 -0600
    Subject: [SDL] Bug report: SDL_CreateRGBSurface with SDL_HWSURFACE crashes
    
    If SDL is in full-screen mode with a hardware video surface on OS X,
    SDL_CreateRGBSurface with SDL_HWSURFACE crashes.  The crash occurs on
    line 109 of SDL_Surface.c.  This was tested on OS X 10.3.9 with both SDL
    1.2.8 and the latest CVS.  Here is a small C++ program that demonstrates
    the problem:
    
    #include "SDL.h"
    #include <stdio.h>
    
    namespace {
    
       void wait_for_key()
       {
         SDL_Event e;
         printf("%d\n", SDL_GetAppState());
         while (SDL_WaitEvent(&e)) {
           if (e.type == SDL_KEYDOWN || e.type == SDL_QUIT) return;
         }
       }
    
    }
    
    int main(int, char *[])
    {
       SDL_Init(SDL_INIT_VIDEO);
       SDL_Surface *screen
         = SDL_SetVideoMode(640, 480, 32, SDL_FULLSCREEN | SDL_HWSURFACE);
       SDL_Surface *s = SDL_CreateRGBSurface(SDL_HWSURFACE, 640, 480, 32,
           screen->format->Rmask, screen->format->Gmask,
           screen->format->Bmask, screen->format->Amask);
       wait_for_key();
       if (s) SDL_FreeSurface(s);
       SDL_Quit();
       printf("Success!\n");
       return 0;
    }
    
    --HG--
    extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401121
    351fcc95
Name
Last commit
Last update
..
audio Loading commit data...
cdrom Loading commit data...
cpuinfo Loading commit data...
endian Loading commit data...
events Loading commit data...
file Loading commit data...
hermes Loading commit data...
joystick Loading commit data...
main Loading commit data...
thread Loading commit data...
timer Loading commit data...
video Loading commit data...
.cvsignore Loading commit data...
Makefile.am Loading commit data...
SDL.c Loading commit data...
SDL_error.c Loading commit data...
SDL_error_c.h Loading commit data...
SDL_fatal.c Loading commit data...
SDL_fatal.h Loading commit data...
SDL_getenv.c Loading commit data...
SDL_loadso.c Loading commit data...