From: Derek Foreman Date: Mon, 26 Jun 2017 20:55:44 +0000 (-0500) Subject: dmabuf: Don't crash clients by sending version inappropriate events X-Git-Tag: upstream/5.0.0~514 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbc206e948352b79e240a6898f3ada0c46d0b02a;p=platform%2Fupstream%2Fweston.git dmabuf: Don't crash clients by sending version inappropriate events We need to make sure the client bound dmabuf with a high enough version to receive modifier events before sending them or the client will crash. Signed-off-by: Derek Foreman Reviewed-by: Daniel Stone --- diff --git a/libweston/linux-dmabuf.c b/libweston/linux-dmabuf.c index ac219ac3..d81b63d5 100644 --- a/libweston/linux-dmabuf.c +++ b/libweston/linux-dmabuf.c @@ -483,6 +483,8 @@ bind_linux_dmabuf(struct wl_client *client, wl_resource_set_implementation(resource, &linux_dmabuf_implementation, compositor, NULL); + if (version < ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION) + return; /* * Use EGL_EXT_image_dma_buf_import_modifiers to query and advertise * format/modifier codes.