create_offscreen_window_surface() expects to borrow a reference from *window_surface argument if it is not NULL.
Fixes: 8dd4b62e4c7 (win32u: Move offscreen window surface creation fallback., 2024-06-27)
From: Jinoh Kang jinoh.kang.kr@gmail.com
create_offscreen_window_surface() expects to borrow a reference from *window_surface argument if it is not NULL.
Fixes: 8dd4b62e4c7 (win32u: Move offscreen window surface creation fallback., 2024-06-27) --- dlls/win32u/dce.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 2faf73f2f53..da70e443589 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -136,6 +136,8 @@ static void create_offscreen_window_surface( HWND hwnd, const RECT *surface_rect info->bmiHeader.biCompression = BI_RGB;
*window_surface = window_surface_create( sizeof(*surface), &offscreen_window_surface_funcs, hwnd, surface_rect, info, 0 ); + + if (previous) window_surface_release( previous ); }
struct scaled_surface @@ -283,7 +285,6 @@ void create_window_surface( HWND hwnd, BOOL create_layered, const RECT *surface_ if (driver_surface) window_surface_release( driver_surface ); if (*window_surface) { - window_surface_release( *window_surface ); /* create an offscreen window surface if the driver doesn't implement CreateWindowSurface */ create_offscreen_window_surface( hwnd, surface_rect, window_surface ); }
This merge request was approved by Rémi Bernon.
Failures in ddraw2, ddraw7, and urlmon seem unrelated.