diff --git a/reactos/win32ss/gdi/ntgdi/palette.c b/reactos/win32ss/gdi/ntgdi/palette.c index d471850d5e7..ff600d7ce38 100644 --- a/reactos/win32ss/gdi/ntgdi/palette.c +++ b/reactos/win32ss/gdi/ntgdi/palette.c @@ -767,6 +767,11 @@ IntGdiRealizePalette(HDC hDC) return 0; } + if (!pdc->dclevel.pSurface) + { + goto cleanup; + } + ppalSurf = pdc->dclevel.pSurface->ppal; ppalDC = pdc->dclevel.ppal;