Alexandre Julliard : gdi32: Avoid calling get_dc_ptr on a null handle.

Alexandre Julliard julliard at winehq.org
Tue Dec 1 09:19:44 CST 2009


Module: wine
Branch: master
Commit: cc973b0cdc9168dbcfdfd87d5e2b3d5d71b38fa1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=cc973b0cdc9168dbcfdfd87d5e2b3d5d71b38fa1

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Dec  1 14:38:21 2009 +0100

gdi32: Avoid calling get_dc_ptr on a null handle.

---

 dlls/gdi32/dc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/gdi32/dc.c b/dlls/gdi32/dc.c
index c4c5a13..2aeeec2 100644
--- a/dlls/gdi32/dc.c
+++ b/dlls/gdi32/dc.c
@@ -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;
 




More information about the wine-cvs mailing list