mirror of
https://github.com/reactos/reactos.git
synced 2024-07-20 03:16:12 +00:00
Check the surface pointer before accessing it to get a handle
svn path=/trunk/; revision=42866
This commit is contained in:
parent
6be4617f84
commit
9d4ec238ee
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue