Module: wine Branch: master Commit: 7391352a39ac8af37bd76620b51646791b812279 URL: https://gitlab.winehq.org/wine/wine/-/commit/7391352a39ac8af37bd76620b516467...
Author: Zhiyi Zhang zzhang@codeweavers.com Date: Sat Nov 25 22:27:42 2023 +0800
wined3d: Fix a use after free (Coverity).
s is freed in set_window_state_thread().
---
dlls/wined3d/swapchain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index c30c43734c0..8a02847c840 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -2199,8 +2199,6 @@ static void set_window_state(struct wined3d_window_state *s) * messages. */ if (window_tid == tid) { - set_window_state_thread(s); - /* Deus Ex: Game of the Year Edition removes WS_EX_TOPMOST after changing resolutions in * exclusive fullscreen mode. Tests show that WS_EX_TOPMOST will be restored when a ~1.5s * timer times out */ @@ -2211,6 +2209,8 @@ static void set_window_state(struct wined3d_window_state *s) else KillTimer(s->window, WINED3D_WINDOW_TOPMOST_TIMER_ID); } + + set_window_state_thread(s); } else if ((thread = CreateThread(NULL, 0, set_window_state_thread, s, 0, NULL))) {