mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 09:18:04 +02:00
svga: don't use uninitialized framebuffer state
Only the first 'nr_cbufs' color buffers in the pipe_framebuffer_state are
valid. The rest of the color buffer pointers might be unitialized.
Fixes a regression in the piglit fbo-srgb-blit test since changes in the
gallium blitter code.
NOTE: This is a candidate for the 9.0 branch (just to be safe).
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 60a9390978)
This commit is contained in:
parent
b22de71c1b
commit
409cb4fc73
1 changed files with 4 additions and 2 deletions
|
|
@ -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);
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue