Commit cc973b0c authored by Alexandre Julliard's avatar Alexandre Julliard

gdi32: Avoid calling get_dc_ptr on a null handle.

parent e4e55ed8
...@@ -750,8 +750,9 @@ HDC WINAPI CreateCompatibleDC( HDC hdc ) ...@@ -750,8 +750,9 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
GDI_CheckNotLock(); GDI_CheckNotLock();
if ((origDC = get_dc_ptr( hdc ))) if (hdc)
{ {
if (!(origDC = get_dc_ptr( hdc ))) return 0;
if (GetObjectType( hdc ) == OBJ_DC) if (GetObjectType( hdc ) == OBJ_DC)
{ {
funcs = origDC->funcs; funcs = origDC->funcs;
...@@ -760,7 +761,6 @@ HDC WINAPI CreateCompatibleDC( HDC hdc ) ...@@ -760,7 +761,6 @@ HDC WINAPI CreateCompatibleDC( HDC hdc )
release_dc_ptr( origDC ); release_dc_ptr( origDC );
if (funcs) funcs = DRIVER_get_driver( funcs ); if (funcs) funcs = DRIVER_get_driver( funcs );
} }
else if (hdc) return 0;
if (!funcs && !(funcs = DRIVER_load_driver( displayW ))) return 0; if (!funcs && !(funcs = DRIVER_load_driver( displayW ))) return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment