aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/gallium/auxiliary/util/u_framebuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_framebuffer.c')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_framebuffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_framebuffer.c b/mesalib/src/gallium/auxiliary/util/u_framebuffer.c
index 7803ec6a8..f84485d1f 100644
--- a/mesalib/src/gallium/auxiliary/util/u_framebuffer.c
+++ b/mesalib/src/gallium/auxiliary/util/u_framebuffer.c
@@ -88,7 +88,8 @@ util_copy_framebuffer_state(struct pipe_framebuffer_state *dst,
for (i = 0; i < src->nr_cbufs; i++)
pipe_surface_reference(&dst->cbufs[i], src->cbufs[i]);
- for (i = src->nr_cbufs; i < dst->nr_cbufs; i++)
+ /* Set remaining dest cbuf pointers to NULL */
+ for ( ; i < Elements(dst->cbufs); i++)
pipe_surface_reference(&dst->cbufs[i], NULL);
dst->nr_cbufs = src->nr_cbufs;