Sven Baars : wined3d: Avoid accessing freed memory in wined3d_view_gl_destroy() (Valgrind).

Alexandre Julliard julliard at winehq.org
Tue Jun 2 08:11:19 CDT 2020


Module: wine
Branch: stable
Commit: 1653bff66610b6f3d3696fcbb404326f15937a5e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=1653bff66610b6f3d3696fcbb404326f15937a5e

Author: Sven Baars <sbaars at codeweavers.com>
Date:   Sun Feb  2 14:45:51 2020 +0100

wined3d: Avoid accessing freed memory in wined3d_view_gl_destroy() (Valgrind).

Signed-off-by: Sven Baars <sbaars at codeweavers.com>
Signed-off-by: Liam Middlebrook <lmiddlebrook at nvidia.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 4128e457a97d02c4b49c4414829afdbc6d1cb869)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/wined3d/adapter_gl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index c84348afd1..4a0803a626 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -4851,7 +4851,7 @@ static void wined3d_view_gl_destroy(struct wined3d_device *device,
     ctx->free = ctx != &c ? ctx : NULL;
 
     wined3d_cs_destroy_object(device->cs, wined3d_view_gl_destroy_object, ctx);
-    if (!ctx->free)
+    if (ctx == &c)
         device->cs->ops->finish(device->cs, WINED3D_CS_QUEUE_DEFAULT);
 }
 




More information about the wine-cvs mailing list