Author: gschneider Date: Sat Aug 22 20:44:17 2009 New Revision: 42866
URL: http://svn.reactos.org/svn/reactos?rev=42866&view=rev Log: Check the surface pointer before accessing it to get a handle
Modified: trunk/reactos/dll/win32/gdi32/misc/gdientry.c
Modified: trunk/reactos/dll/win32/gdi32/misc/gdientry.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/gdient... ============================================================================== --- trunk/reactos/dll/win32/gdi32/misc/gdientry.c [iso-8859-1] (original) +++ trunk/reactos/dll/win32/gdi32/misc/gdientry.c [iso-8859-1] Sat Aug 22 20:44:17 2009 @@ -2047,15 +2047,18 @@ 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);