[PATCH] initialize swapchain

Marcus Meissner marcus at jet.franken.de
Tue Jan 22 02:27:00 CST 2008


Hi,

Coverity spotted (CID 629) that swapchain can be used
uninitialized in the err_out path, and I have to agree.

Also pulled err_out: label to the front of the line.

Ciao, Marcus
---
 dlls/wined3d/device.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4580c14..8d4dfd7 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -2003,7 +2003,7 @@ static void IWineD3DDeviceImpl_LoadLogo(IWineD3DDeviceImpl *This, const char *fi
 
 static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPRESENT_PARAMETERS* pPresentationParameters, D3DCB_CREATEADDITIONALSWAPCHAIN D3DCB_CreateAdditionalSwapChain) {
     IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
-    IWineD3DSwapChainImpl *swapchain;
+    IWineD3DSwapChainImpl *swapchain = NULL;
     HRESULT hr;
     DWORD state;
 
@@ -2141,7 +2141,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, WINED3DPR
     }
     return WINED3D_OK;
 
-    err_out:
+err_out:
     HeapFree(GetProcessHeap(), 0, This->render_targets);
     HeapFree(GetProcessHeap(), 0, This->fbo_color_attachments);
     HeapFree(GetProcessHeap(), 0, This->draw_buffers);
-- 
1.5.2.4



More information about the wine-patches mailing list