gdi32: Avoid calling get_dc_ptr on a null handle.

This commit is contained in:
Alexandre Julliard 2009-12-01 14:38:21 +01:00
parent e4e55ed8b4
commit cc973b0cdc
1 changed files with 2 additions and 2 deletions

View File

@ -750,8 +750,9 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
GDI_CheckNotLock();
if ((origDC = get_dc_ptr( hdc )))
if (hdc)
{
if (!(origDC = get_dc_ptr( hdc ))) return 0;
if (GetObjectType( hdc ) == OBJ_DC)
{
funcs = origDC->funcs;
@ -760,7 +761,6 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
release_dc_ptr( origDC );
if (funcs) funcs = DRIVER_get_driver( funcs );
}
else if (hdc) return 0;
if (!funcs && !(funcs = DRIVER_load_driver( displayW ))) return 0;