Fix NULL dereference in vrend_draw_bind_samplers_shader

vrend_sub_context.views.views can be set to NULL on user error in
vrend_set_single_sampler_view.

 #0  vrend_draw_bind_samplers_shader ()
 #1  vrend_draw_bind_objects ()
 #2  vrend_draw_vbo ()
 #3  vrend_decode_draw_vbo ()
 #4  vrend_decode_block ()
 #5  virgl_renderer_submit_cmd ()
 #6  virgl_cmd_submit_3d ()

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Elie Tournier <elie.tournier@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
macos/master
Tomeu Vizoso 7 years ago committed by Dave Airlie
parent 87b346a1a3
commit 7a37a364e5
  1. 3
      src/vrend_renderer.c

@ -3118,6 +3118,9 @@ static void vrend_draw_bind_samplers_shader(struct vrend_context *ctx,
for (int i = 0; i < ctx->sub->views[shader_type].num_views; i++) {
struct vrend_sampler_view *tview = ctx->sub->views[shader_type].views[i];
if (!tview)
continue;
if (!(ctx->sub->prog->samplers_used_mask[shader_type] & (1 << i)))
continue;

Loading…
Cancel
Save