From 0eee8d89be4e04a03e8e60063a0812a68922cb63 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 25 Jan 2008 05:48:08 +0000 Subject: [PATCH] Fixed crash in SDL_SetGammaRamp() --- src/video/windib/SDL_dibvideo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/windib/SDL_dibvideo.c b/src/video/windib/SDL_dibvideo.c index cfb2b5fd3..734be7eda 100644 --- a/src/video/windib/SDL_dibvideo.c +++ b/src/video/windib/SDL_dibvideo.c @@ -784,8 +784,10 @@ SDL_Surface *DIB_SetVideoMode(_THIS, SDL_Surface *current, 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 */