Fixed crash in SDL_SetGammaRamp() SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Fri, 25 Jan 2008 05:48:08 +0000
branchSDL-1.2
changeset 4136 8797fa6e2fb2
parent 4135 cd98d1dc385c
child 4137 be12463f31ea
Fixed crash in SDL_SetGammaRamp()
src/video/windib/SDL_dibvideo.c
--- a/src/video/windib/SDL_dibvideo.c	Thu Jan 24 15:50:20 2008 +0000
+++ b/src/video/windib/SDL_dibvideo.c	Fri Jan 25 05:48:08 2008 +0000
@@ -784,8 +784,10 @@
 		if ( screen_pal && (flags & (SDL_FULLSCREEN|SDL_HWPALETTE)) ) {
 			grab_palette = TRUE;
 		}
-		/* BitBlt() maps colors for us */
-		video->flags |= SDL_HWPALETTE;
+		if ( screen_pal ) {
+			/* BitBlt() maps colors for us */
+			video->flags |= SDL_HWPALETTE;
+		}
 	}
 #ifndef _WIN32_WCE
 	/* Resize the window */