From: Paul Gofman Subject: [PATCH] wined3d: Avoid crash in swapchain_gl_present() if context could not be acquired. Message-Id: <20191113151515.1455279-1-gofmanp@gmail.com> Date: Wed, 13 Nov 2019 18:15:15 +0300 Signed-off-by: Paul Gofman --- dlls/wined3d/swapchain.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 62bab65fcf..e4ffce8965 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -453,7 +453,12 @@ static void swapchain_gl_present(struct wined3d_swapchain *swapchain, struct wined3d_context *context; BOOL render_to_fbo; - context = context_acquire(swapchain->device, swapchain->front_buffer, 0); + if (!(context = context_acquire(swapchain->device, swapchain->front_buffer, 0))) + { + WARN("Could not get context, skipping present.\n"); + return; + } + context_gl = wined3d_context_gl(context); if (!context_gl->valid) { -- 2.23.0