Browse Source

svga: fix referencing a NULL framebuffer cbuf

Check for a valid framebuffer cbuf pointer before accessing its
associated surface.

Fix piglit test fbo-drawbuffers-none.

Reviewed-by: Brian Paul <brianp@vmware.com>
tags/11.1-branchpoint
Charmaine Lee 10 years ago
parent
commit
4a9480b64a
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/gallium/drivers/svga/svga_pipe_sampler.c

+ 2
- 2
src/gallium/drivers/svga/svga_pipe_sampler.c View File

@@ -455,8 +455,8 @@ svga_set_sampler_views(struct pipe_context *pipe,
* for the conflicted surface view.
*/
for (i = 0; i < svga->curr.framebuffer.nr_cbufs; i++) {
struct svga_surface *s = svga_surface(svga->curr.framebuffer.cbufs[i]);
if (s) {
if (svga->curr.framebuffer.cbufs[i]) {
struct svga_surface *s = svga_surface(svga->curr.framebuffer.cbufs[i]);
if (svga_check_sampler_view_resource_collision(svga, s->handle, shader)) {
svga->dirty |= SVGA_NEW_FRAME_BUFFER;
break;

Loading…
Cancel
Save