summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2/egl_dri2.c
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <[email protected]>2017-09-28 03:18:33 -0400
committerDaniel Stone <[email protected]>2018-02-15 11:58:17 +0000
commita34715ad9c84c4209de4c16fdf40655181350bd9 (patch)
tree7c3fba35424f8364fd77d290380a1dd87c2afc16 /src/egl/drivers/dri2/egl_dri2.c
parentf0654dfa65e4004bcc9a4bea80f1e6a04a75ecff (diff)
dri: fromPlanar() can return NULL as a valid result
It was assumed that fromPlanar() could return NULL to mean that the planar image is the same as the parent DRI image. That assumption wasn't made everywhere though. Let's fix things and make sure that all callers understand a NULL result Signed-off-by: Louis-Francis Ratté-Boulianne <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.c')
-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 e9b556ec5f7..17b646e7ede 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1966,7 +1966,8 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
}
dri_image = dri2_dpy->image->fromPlanar(buffer->driver_buffer, plane, NULL);
-
+ if (dri_image == NULL && plane == 0)
+ dri_image = dri2_dpy->image->dupImage(buffer->driver_buffer, NULL);
if (dri_image == NULL) {
_eglError(EGL_BAD_PARAMETER, "dri2_create_image_wayland_wl_buffer");
return NULL;