From 34c9f9fb3904dbc2af1cae388db7e022b56bc97a Mon Sep 17 00:00:00 2001
From: Marcus Meissner <marcus@jet.franken.de>
Date: Sat, 16 Dec 2000 20:17:22 +0000
Subject: [PATCH] Check for NULL before doing IsEqualGUID().

---
 dlls/ddraw/main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c
index a7e991ed3b6..30722e56fa8 100644
--- a/dlls/ddraw/main.c
+++ b/dlls/ddraw/main.c
@@ -316,9 +316,11 @@ HRESULT WINAPI DirectDrawCreate(
 	ddraw_drivers[drvindex] = NULL; /* mark this one as unusable */
     }
 
-    if (IsEqualGUID( &IID_IDirectDraw2, lpGUID ) ||
-	IsEqualGUID( &IID_IDirectDraw4, lpGUID ) ||
-	IsEqualGUID( &IID_IDirectDraw7, lpGUID )
+    if (lpGUID &&
+	(IsEqualGUID( &IID_IDirectDraw2, lpGUID ) ||
+	 IsEqualGUID( &IID_IDirectDraw4, lpGUID ) ||
+	 IsEqualGUID( &IID_IDirectDraw7, lpGUID )
+	)
     ) {
 	LPVOID x;
 	ret = IDirectDraw_QueryInterface(*lplpDD,lpGUID,&x);
-- 
GitLab