Nikolay Sivov : d3d11: Fix freed memory access when releasing device context (Coverity).

Alexandre Julliard julliard at winehq.org
Thu Jun 10 16:04:51 CDT 2021


Module: wine
Branch: master
Commit: d26275f9053f46b71c6325cc1cade0c7cc5921dd
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d26275f9053f46b71c6325cc1cade0c7cc5921dd

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Wed Jun  9 08:57:00 2021 +0300

d3d11: Fix freed memory access when releasing device context (Coverity).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index d3e49879676..56f34c70ea1 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -521,13 +521,14 @@ static ULONG STDMETHODCALLTYPE d3d11_device_context_Release(ID3D11DeviceContext1
 
     if (!refcount)
     {
+        ID3D11Device2 *device = &context->device->ID3D11Device2_iface;
         if (context->type != D3D11_DEVICE_CONTEXT_IMMEDIATE)
         {
             wined3d_deferred_context_destroy(context->wined3d_context);
             d3d11_device_context_cleanup(context);
             heap_free(context);
         }
-        ID3D11Device2_Release(&context->device->ID3D11Device2_iface);
+        ID3D11Device2_Release(device);
     }
 
     return refcount;




More information about the wine-cvs mailing list