mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
winlayer.c: in WM_PALETTECHANGED handling code ("someone stole the palette
so try and steal it back"), prevent calling IDirectDrawSurface_SetPalette() with NULL arguments, causing a crash. It's happened for me on Vista, when initially changing from 8-bit to 32-bit mode. git-svn-id: https://svn.eduke32.com/eduke32@2255 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a57b566c0b
commit
87ac6b8406
1 changed files with 8 additions and 1 deletions
|
@ -3706,7 +3706,14 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
|
||||||
// someone stole the palette so try and steal it back
|
// someone stole the palette so try and steal it back
|
||||||
if (bDDrawInited && bpp == 8 && fullscreen)
|
if (bDDrawInited && bpp == 8 && fullscreen)
|
||||||
{
|
{
|
||||||
int32_t result = IDirectDrawSurface_SetPalette(lpDDSPrimary, lpDDPalette);
|
int32_t result;
|
||||||
|
|
||||||
|
// PK: for me, happens on Vista when changing from fullscreen 8-bit to 32-bit
|
||||||
|
if (!lpDDSPrimary || !lpDDPalette)
|
||||||
|
break;
|
||||||
|
|
||||||
|
result = IDirectDrawSurface_SetPalette(lpDDSPrimary, lpDDPalette);
|
||||||
|
|
||||||
if (result != DD_OK)
|
if (result != DD_OK)
|
||||||
{
|
{
|
||||||
initprintf("Palette set failed: %s\n", GetDDrawError(result));
|
initprintf("Palette set failed: %s\n", GetDDrawError(result));
|
||||||
|
|
Loading…
Reference in a new issue