mirror of
https://github.com/reactos/reactos.git
synced 2024-09-05 18:26:53 +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)
|
BOOL bRelease)
|
||||||
{
|
{
|
||||||
HANDLE hDD = NULL;
|
HANDLE hDD = NULL;
|
||||||
HANDLE hSurface = (HANDLE)pSurface->hDDSurface;
|
HANDLE hSurface = NULL;
|
||||||
|
|
||||||
/* Check if we already have a surface */
|
/* Check if we already have a surface */
|
||||||
if (!pSurface)
|
if (!pSurface)
|
||||||
{
|
{
|
||||||
/* We don't have one, use the DirectDraw Object handle instead */
|
/* We don't have one, use the DirectDraw Object handle instead */
|
||||||
hSurface = NULL;
|
|
||||||
hDD = GetDdHandle(pDDraw->lpGbl->hDD);
|
hDD = GetDdHandle(pDDraw->lpGbl->hDD);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hSurface = (HANDLE)pSurface->hDDSurface;
|
||||||
|
}
|
||||||
|
|
||||||
/* Call the API */
|
/* Call the API */
|
||||||
return (HANDLE)NtGdiDdGetDxHandle(hDD, hSurface, bRelease);
|
return (HANDLE)NtGdiDdGetDxHandle(hDD, hSurface, bRelease);
|
||||||
|
|
Loading…
Reference in a new issue