[PATCH 1/3] dxgi: Avoid possible NULL pointer access in d3d11_swapchain_SetFullscreenState().

Józef Kucia jkucia at codeweavers.com
Mon Jul 9 08:25:54 CDT 2018


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/dxgi/swapchain.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c
index fb91eec9d9a1..ae7bde73995c 100644
--- a/dlls/dxgi/swapchain.c
+++ b/dlls/dxgi/swapchain.c
@@ -252,12 +252,11 @@ static HRESULT STDMETHODCALLTYPE DECLSPEC_HOTPATCH d3d11_swapchain_SetFullscreen
         if (swapchain->target)
             IDXGIOutput_Release(swapchain->target);
         swapchain->target = target;
-    }
-    else
-    {
-        IDXGIOutput_Release(target);
+        return S_OK;
     }
 
+    if (target)
+        IDXGIOutput_Release(target);
     return hr;
 }
 
-- 
2.16.4




More information about the wine-devel mailing list