[PATCH] check return value of get_dc_ptr

Marcus Meissner marcus at jet.franken.de
Tue Oct 2 14:11:06 CDT 2007


Coverity also spotted this one, and I agree.

Ciao, Marcus
---
 dlls/gdi32/enhmfdrv/dc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/gdi32/enhmfdrv/dc.c b/dlls/gdi32/enhmfdrv/dc.c
index 0115991..b4eb92a 100644
--- a/dlls/gdi32/enhmfdrv/dc.c
+++ b/dlls/gdi32/enhmfdrv/dc.c
@@ -37,6 +37,9 @@ BOOL EMFDRV_RestoreDC( PHYSDEV dev, INT
     DC *dc = get_dc_ptr( physDev->hdc );
     EMRRESTOREDC emr;
 
+    if (!dc)
+        return FALSE;
+
     emr.emr.iType = EMR_RESTOREDC;
     emr.emr.nSize = sizeof(emr);
 
-- 
1.4.3.4



More information about the wine-patches mailing list