Marcus Meissner : wined3d: Fixed swapchain context NULL ptr checks.

Alexandre Julliard julliard at wine.codeweavers.com
Mon May 14 10:52:31 CDT 2007


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

Author: Marcus Meissner <marcus at jet.franken.de>
Date:   Sat May 12 10:22:42 2007 +0200

wined3d: Fixed swapchain context NULL ptr checks.

---

 dlls/wined3d/device.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 16df8a5..223cdb4 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -1366,15 +1366,15 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateAdditionalSwapChain(IWineD3DDevic
     /** FIXME: Handle stencil appropriately via EnableAutoDepthStencil / AutoDepthStencilFormat **/
 
     object->context = HeapAlloc(GetProcessHeap(), 0, sizeof(object->context));
-    if(!object->context) {
-    }
+    if(!object->context)
+	return E_OUTOFMEMORY;
     object->num_contexts = 1;
 
     ENTER_GL();
     object->context[0] = CreateContext(This, (IWineD3DSurfaceImpl *) object->frontBuffer, display, object->win);
     LEAVE_GL();
 
-    if (!object->context) {
+    if (!object->context[0]) {
         ERR("Failed to create a new context\n");
         hr = WINED3DERR_NOTAVAILABLE;
         goto error;
@@ -1517,9 +1517,8 @@ error:
         HeapFree(GetProcessHeap(), 0, object->backBuffer);
         object->backBuffer = NULL;
     }
-    if(object->context) {
+    if(object->context[0])
         DestroyContext(This, object->context[0]);
-    }
     if(object->frontBuffer) {
         IWineD3DSurface_GetParent(object->frontBuffer, &bufferParent);
         IUnknown_Release(bufferParent); /* once for the get parent */




More information about the wine-cvs mailing list