summaryrefslogtreecommitdiff
path: root/src/egl/drivers/dri2
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2017-10-10 18:50:13 +0100
committerEmil Velikov <emil.l.velikov@gmail.com>2017-10-13 12:56:12 +0100
commit872a373bc829b7eb6d94063023934b3713185d75 (patch)
tree19ed8ce11e7cab200ad2ed1b9260ecb739ff73ef /src/egl/drivers/dri2
parent2289964f4f2aede298317d89bc96d9e2aa3ff766 (diff)
egl/dri: don't crash when createImageFromRenderbuffer2 is NULL
The __DRI_IMAGE version can be 17 or over, while the function pointer is NULL. Guard for that instead of crashing. Fixes: bad24395d91 ("egl/dri: use createImageFromRenderbuffer2 when available") Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 5334384d2f..d5cdf32afa 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1890,7 +1890,8 @@ dri2_create_image_khr_renderbuffer(_EGLDisplay *disp, _EGLContext *ctx,
return EGL_NO_IMAGE_KHR;
}
- if (dri2_dpy->image->base.version >= 17) {
+ if (dri2_dpy->image->base.version >= 17 &&
+ dri2_dpy->image->createImageFromRenderbuffer2) {
unsigned error = ~0;
dri_image = dri2_dpy->image->createImageFromRenderbuffer2(