Fix crash in the X11 HAL when setting a NULL palette to a surface.

This commit is contained in:
Lionel Ulmer 2002-02-26 00:36:21 +00:00 committed by Alexandre Julliard
parent 519d4864ea
commit e88edac600
2 changed files with 6 additions and 4 deletions

View File

@ -223,7 +223,7 @@ void HAL_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
DIB_DirectDrawSurface_set_palette(This, pal);
data.lpDD = dd_gbl;
data.lpDDSurface = &This->local;
data.lpDDPalette = &pal->global;
data.lpDDPalette = (pal != NULL ? &pal->global : NULL);
data.ddRVal = 0;
data.Attach = TRUE; /* what's this? */
data.SetPalette = dd_gbl->lpDDCBtmp->HALDDSurface.SetPalette;

View File

@ -159,12 +159,14 @@ static DWORD PASCAL X11DRV_DDHAL_DestroySurface(LPDDHAL_DESTROYSURFACEDATA data)
static DWORD PASCAL X11DRV_DDHAL_SetPalette(LPDDHAL_SETPALETTEDATA data)
{
Colormap pal = data->lpDDPalette->u1.dwReserved1;
if (pal) {
if (data->lpDDPalette && data->lpDDPalette->u1.dwReserved1) {
if (data->lpDDSurface == X11DRV_DD_Primary) {
FIXME("stub\n");
/* we should probably find the ddraw window (maybe data->lpDD->lpExclusiveOwner->hWnd),
* and attach the palette to it */
* and attach the palette to it
*
* Colormap pal = data->lpDDPalette->u1.dwReserved1;
*/
}
}
data->ddRVal = DD_OK;