Check the surface pointer before accessing it to get a handle

svn path=/trunk/; revision=42866
This commit is contained in:
Gregor Schneider 2009-08-22 18:44:17 +00:00
parent 6be4617f84
commit 9d4ec238ee

View file

@ -2047,15 +2047,18 @@ DdGetDxHandle(LPDDRAWI_DIRECTDRAW_LCL pDDraw,
BOOL bRelease)
{
HANDLE hDD = NULL;
HANDLE hSurface = (HANDLE)pSurface->hDDSurface;
HANDLE hSurface = NULL;
/* Check if we already have a surface */
if (!pSurface)
{
/* We don't have one, use the DirectDraw Object handle instead */
hSurface = NULL;
hDD = GetDdHandle(pDDraw->lpGbl->hDD);
}
}
else
{
hSurface = (HANDLE)pSurface->hDDSurface;
}
/* Call the API */
return (HANDLE)NtGdiDdGetDxHandle(hDD, hSurface, bRelease);