[weston] gl-renderer: conditionally call query_buffer while gl_renderer_attach

Vincent Abriou vincent.abriou at st.com
Fri Oct 7 15:08:51 UTC 2016


While gl_renderer_attach, query_buffer should be call only if the
query_buffer function exists.

Signed-off-by: Vincent Abriou <vincent.abriou at st.com>
---
 libweston/gl-renderer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
index 6276188..caa72d7 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
@@ -2004,7 +2004,8 @@ gl_renderer_attach(struct weston_surface *es, struct weston_buffer *buffer)
 
 	if (shm_buffer)
 		gl_renderer_attach_shm(es, buffer, shm_buffer);
-	else if (gr->query_buffer(gr->egl_display, (void *) buffer->resource,
+	else if (gr->query_buffer &&
+		 gr->query_buffer(gr->egl_display, (void *)buffer->resource,
 				  EGL_TEXTURE_FORMAT, &format))
 		gl_renderer_attach_egl(es, buffer, format);
 	else if ((dmabuf = linux_dmabuf_buffer_get(buffer->resource)))
-- 
1.9.1



More information about the wayland-devel mailing list