From 2e4c9057551a3adfcaaf6ba744f9555fd4b51eb0 Mon Sep 17 00:00:00 2001
From: Eric Pouech <Eric.Pouech@wanadoo.fr>
Date: Tue, 22 Jun 1999 19:04:44 +0000
Subject: [PATCH] Fixed error handling in DGA_IDirectDraw2Impl_GetCaps().

---
 graphics/ddraw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/graphics/ddraw.c b/graphics/ddraw.c
index 29c1a658d0a..a16b6ca0bc0 100644
--- a/graphics/ddraw.c
+++ b/graphics/ddraw.c
@@ -1557,7 +1557,7 @@ static HRESULT WINAPI IDirectDrawSurface4Impl_GetDC(LPDIRECTDRAWSURFACE4 iface,H
 					  b_info,
 					  usage,
 					  &(This->s.bitmap_data),
-					  NULL,
+					  (HANDLE)0,
 					  0);
     EndPaint(This->s.ddraw->d.mainWindow,&This->s.ddraw->d.ps);
     TRACE(ddraw, "DIBSection at : %p\n", This->s.bitmap_data);
@@ -3643,6 +3643,8 @@ static HRESULT WINAPI DGA_IDirectDraw2Impl_GetCaps(
 #ifdef HAVE_LIBXXF86DGA
         ICOM_THIS(IDirectDraw2Impl,iface);
 	TRACE(ddraw,"(%p)->GetCaps(%p,%p)\n",This,caps1,caps2);
+	if (!caps1 && !caps2)
+	   return DDERR_INVALIDPARAMS;
 	if (caps1) {
 		caps1->dwVidMemTotal = This->e.dga.fb_memsize;
 		caps1->dwCaps = 0xffffffff&~(DDCAPS_BANKSWITCHED);		/* we can do anything */
-- 
GitLab