From a6483f043440d4a531592fb121e77316df09c2cf Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Tue, 13 Sep 2022 17:41:29 -0400 Subject: [PATCH] egl/dri2: Fix some thinkos in old context release All of the objects here should be relative to the old context / display / surfaces. Calling disp->unbindContext() on a context that disp did not create is likely to go poorly. Reviewed-by: Eric Engestrom Part-of: --- src/egl/drivers/dri2/egl_dri2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index adc272c..ba3ea86 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1822,10 +1822,10 @@ dri2_make_current(_EGLDisplay *disp, _EGLSurface *dsurf, old_dri2_dpy->vtbl->set_shared_buffer_mode(old_disp, old_dsurf, false); } - dri2_dpy->core->unbindContext(old_cctx); + old_dri2_dpy->core->unbindContext(old_cctx); if (old_dsurf) - dri2_surf_update_fence_fd(old_ctx, disp, old_dsurf); + dri2_surf_update_fence_fd(old_ctx, old_disp, old_dsurf); } ddraw = (dsurf) ? dri2_dpy->vtbl->get_dri_drawable(dsurf) : NULL; -- 2.7.4