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 <erik.faye-lund@collabora.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
[airlied: fix whitespace]
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Erik Faye-Lund 6 years ago committed by Dave Airlie
parent 474addf576
commit 262b078c3d
  1. 5
      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); glBindBufferARB(GL_TEXTURE_BUFFER, iview->texture->id);
glBindTexture(GL_TEXTURE_BUFFER, iview->texture->tbo_tex_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; tex_id = iview->texture->tbo_tex_id;
level = first_layer = 0; level = first_layer = 0;
layered = GL_TRUE; layered = GL_TRUE;

Loading…
Cancel
Save