Skip to content
Snippets Groups Projects
Commit e88edac6 authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard
Browse files

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

parent 519d4864
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment