aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/svga/svga_pipe_misc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_misc.c b/src/gallium/drivers/svga/svga_pipe_misc.c
index 56f25993134..2b6269a7b2e 100644
--- a/src/gallium/drivers/svga/svga_pipe_misc.c
+++ b/src/gallium/drivers/svga/svga_pipe_misc.c
@@ -107,8 +107,10 @@ static void svga_set_framebuffer_state(struct pipe_context *pipe,
}
}
- for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++)
- pipe_surface_reference(&dst->cbufs[i], fb->cbufs[i]);
+ for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
+ pipe_surface_reference(&dst->cbufs[i],
+ (i < fb->nr_cbufs) ? fb->cbufs[i] : NULL);
+ }
pipe_surface_reference(&dst->zsbuf, fb->zsbuf);