mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
wgl: Don't crash in stw_make_current if current framebuffer is NULL
Fixes #3878 Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7999>
This commit is contained in:
parent
255ca7ecda
commit
a2751080aa
1 changed files with 14 additions and 4 deletions
|
|
@ -446,11 +446,21 @@ stw_make_current(HDC hDrawDC, HDC hReadDC, DHGLRC dhglrc)
|
|||
}
|
||||
} else {
|
||||
if (old_ctx->shared) {
|
||||
stw_st_flush(old_ctx->st, old_ctx->current_framebuffer->stfb,
|
||||
ST_FLUSH_FRONT | ST_FLUSH_WAIT);
|
||||
if (old_ctx->current_framebuffer) {
|
||||
stw_st_flush(old_ctx->st, old_ctx->current_framebuffer->stfb,
|
||||
ST_FLUSH_FRONT | ST_FLUSH_WAIT);
|
||||
} else {
|
||||
struct pipe_fence_handle *fence = NULL;
|
||||
old_ctx->st->flush(old_ctx->st,
|
||||
ST_FLUSH_FRONT | ST_FLUSH_WAIT, &fence,
|
||||
NULL, NULL);
|
||||
}
|
||||
} else {
|
||||
stw_st_flush(old_ctx->st, old_ctx->current_framebuffer->stfb,
|
||||
ST_FLUSH_FRONT);
|
||||
if (old_ctx->current_framebuffer)
|
||||
stw_st_flush(old_ctx->st, old_ctx->current_framebuffer->stfb,
|
||||
ST_FLUSH_FRONT);
|
||||
else
|
||||
old_ctx->st->flush(old_ctx->st, ST_FLUSH_FRONT, NULL, NULL, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue