Author: gschneider
Date: Sun Sep 28 14:44:58 2008
New Revision: 36579
URL:
http://svn.reactos.org/svn/reactos?rev=36579&view=rev
Log:
Check for NULL before using the DC.
Fixes Coverity CID 680.
Modified:
trunk/reactos/subsystems/win32/win32k/objects/brush.c
Modified: trunk/reactos/subsystems/win32/win32k/objects/brush.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ob…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/brush.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/brush.c [iso-8859-1] Sun Sep 28 14:44:58
2008
@@ -599,14 +599,17 @@
BOOL STDCALL
NtGdiSetBrushOrg(HDC hDC, INT XOrg, INT YOrg, LPPOINT Point)
{
- PDC dc = DC_LockDc(hDC);
- PDC_ATTR Dc_Attr = dc->pDc_Attr;
- if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
+ PDC dc;
+ PDC_ATTR Dc_Attr;
+
+ dc = DC_LockDc(hDC);
if (dc == NULL)
{
SetLastWin32Error(ERROR_INVALID_HANDLE);
return FALSE;
}
+ Dc_Attr = dc->pDc_Attr;
+ if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
if (Point != NULL)
{