summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Binns <[email protected]>2018-02-22 13:37:54 +0000
committerEric Engestrom <[email protected]>2018-02-23 11:13:22 +0000
commit6160bf97db8bc493512795b1fa49c072a703df50 (patch)
tree498e11ea2e37065dca52b12ff5b9ca35e66b26fc
parente1623b303ccc7a880e34bddef7231dcf230826b3 (diff)
egl/dri2: fix segfault when display initialisation fails
dri2_display_destroy() is called when platform specific display initialisation fails. However, this would typically lead to a segfault due to the dri2_egl_display vbtl not having been set up. Fixes: 2db95482964 ("loader_dri3/glx/egl: Optionally use a blit context for blitting operations") Signed-off-by: Frank Binns <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 17b646e7ede..c06a0ca0995 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -973,7 +973,7 @@ dri2_display_destroy(_EGLDisplay *disp)
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
if (dri2_dpy->own_dri_screen) {
- if (dri2_dpy->vtbl->close_screen_notify)
+ if (dri2_dpy->vtbl && dri2_dpy->vtbl->close_screen_notify)
dri2_dpy->vtbl->close_screen_notify(disp);
dri2_dpy->core->destroyScreen(dri2_dpy->dri_screen);
}