summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2016-08-18 16:43:36 +0100
committerEmil Velikov <[email protected]>2016-10-14 12:16:06 +0100
commitd6dcf3b4ca7053e9c49780a398c3baabd884ff2c (patch)
tree6ef580a318c63ffc1519f8d45f01017732f2f903 /src
parent8fb9ea413de31cc6a95ac4c38215b621de728687 (diff)
egl/dri2: bail out on NULL dpy in dri2_display_release()
Currently all callers are careful enough not to do that, yet that will not be the case in the future. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index dacdfbd74f5..f2ed3c7d3a2 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -851,9 +851,14 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
static void
dri2_display_release(_EGLDisplay *disp)
{
- struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+ struct dri2_egl_display *dri2_dpy;
unsigned i;
+ if (!disp)
+ return;
+
+ dri2_dpy = dri2_egl_display(disp);
+
assert(dri2_dpy->ref_count > 0);
dri2_dpy->ref_count--;