lavapipe: zero fb attachment array at rp start

this avoids invalid access if an attachment moves to a lower index
in a smaller renderpass

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24339>
This commit is contained in:
Mike Blumenkrantz 2023-07-26 16:21:08 -04:00 committed by Marge Bot
parent b39815fa9c
commit 33d06f8cc2

View file

@ -1713,6 +1713,7 @@ handle_begin_rendering(struct vk_cmd_queue_entry *cmd,
state->framebuffer.nr_cbufs = info->colorAttachmentCount;
state->color_att_count = info->colorAttachmentCount;
memset(state->framebuffer.cbufs, 0, sizeof(state->framebuffer.cbufs));
for (unsigned i = 0; i < info->colorAttachmentCount; i++) {
render_att_init(&state->color_att[i], &info->pColorAttachments[i], state->poison_mem, false);
if (state->color_att[i].imgv) {