[PATCH] winex11.drv: Check for org NULL (Coverity)

Marcus Meissner marcus at jet.franken.de
Fri Jun 12 11:10:46 CDT 2009


Hi,

Coverity thinks org needs to be better checked for NULL.

Ciao, Marcus
---
 dlls/winex11.drv/opengl.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index f207a32..8b8400f 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1933,11 +1933,16 @@ BOOL CDECL X11DRV_wglShareLists(HGLRC hglrc1, HGLRC hglrc2) {
 
     if (!has_opengl()) return FALSE;
 
+    if (!org) {
+        ERR("org must not be NULL!\n");
+        return FALSE;
+    }
+
     if (NULL != dest && dest->ctx != NULL) {
         ERR("Could not share display lists, context already created !\n");
         return FALSE;
     } else {
-        if(org && dest && (GetObjectType(org->hdc) == OBJ_MEMDC) ^ (GetObjectType(dest->hdc) == OBJ_MEMDC)) {
+        if(dest && (GetObjectType(org->hdc) == OBJ_MEMDC) ^ (GetObjectType(dest->hdc) == OBJ_MEMDC)) {
             WARN("Attempting to share a context between a direct and indirect rendering context, expect issues!\n");
         }
 
-- 
1.5.6



More information about the wine-patches mailing list