SDL/src
Ryan C. Gordon f35e5d6e9b Patch by me to fix crash described below.
--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;
}
2005-08-18 06:46:32 +00:00
..
audio Sleep a bit less in thread 2005-08-16 09:57:16 +00:00
cdrom Date: Tue, 22 Mar 2005 23:50:20 +0100 2005-05-20 07:34:34 +00:00
cpuinfo Date: Mon, 10 May 2004 10:17:46 -0400 2004-05-16 17:19:48 +00:00
endian Updated copyright information for 2004 (Happy New Year!) 2004-01-04 16:49:27 +00:00
events Fix various problems with the timer code. 2005-01-13 23:24:56 +00:00
file Patch from Antonio SJ Musumeci: 2005-06-24 12:48:38 +00:00
hermes Updated libtool support so Mingw32 builds work. 2003-10-06 07:13:16 +00:00
joystick Forgot enumeration value for Atari clones 2005-06-25 18:21:13 +00:00
main In MacOSX, when drag'n'dropping a document on an SDL app, or double-clicking a 2005-08-11 00:56:16 +00:00
thread Date: Fri, 15 Jul 2005 08:29:01 +0100 2005-07-21 06:19:18 +00:00
timer From: Jim Paris <jim_jtan_com> 2005-08-17 00:19:45 +00:00
video Patch by me to fix crash described below. 2005-08-18 06:46:32 +00:00
.cvsignore
Makefile.am Actually hook the cpuinfo module into the library. :) 2003-11-18 02:16:57 +00:00
SDL_error_c.h Date: Mon, 3 May 2004 03:15:01 +0100 2004-07-18 22:57:40 +00:00
SDL_error.c Updated copyright information for 2004 (Happy New Year!) 2004-01-04 16:49:27 +00:00
SDL_fatal.c Oops, ignore SIGALRM, not 0 2004-02-26 19:57:37 +00:00
SDL_fatal.h Updated copyright information for 2004 (Happy New Year!) 2004-01-04 16:49:27 +00:00
SDL_getenv.c Updated copyright information for 2004 (Happy New Year!) 2004-01-04 16:49:27 +00:00
SDL_loadso.c Date: Mon, 5 Jan 2004 00:09:36 +0100 2004-01-05 01:34:34 +00:00
SDL.c Updated copyright information for 2004 (Happy New Year!) 2004-01-04 16:49:27 +00:00