From 262b078c3d664416e3279a6cfff0d2a19cd5b17c Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Tue, 22 Jan 2019 14:01:35 +0100 Subject: [PATCH] renderer: guard call to glTexBuffer We shouldn't call glTexBuffer unless we know the feature is enabled, otherwise a rouge client might be able to crash the host. Signed-off-by: Erik Faye-Lund Reviewed-by: Gurchetan Singh [airlied: fix whitespace] Signed-off-by: Dave Airlie --- src/vrend_renderer.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 7a520c7..3a33ad1 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -3791,7 +3791,10 @@ static void vrend_draw_bind_images_shader(struct vrend_context *ctx, int shader_ glBindBufferARB(GL_TEXTURE_BUFFER, iview->texture->id); glBindTexture(GL_TEXTURE_BUFFER, iview->texture->tbo_tex_id); - glTexBuffer(GL_TEXTURE_BUFFER, format, iview->texture->id); + + if (has_feature(feat_arb_or_gles_ext_texture_buffer)) + glTexBuffer(GL_TEXTURE_BUFFER, format, iview->texture->id); + tex_id = iview->texture->tbo_tex_id; level = first_layer = 0; layered = GL_TRUE;