radv/winsys: fix allocating the number of CS in the sysmem path

Found with Valgrind and dEQP-VK.api.command_buffers.record_many_draws*.

Cc: 21.1 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10376>
(cherry picked from commit ec0d3701cd)
This commit is contained in:
Samuel Pitoiset 2021-04-21 15:58:27 +02:00 committed by Eric Engestrom
parent db1b074110
commit cebc8191a8
2 changed files with 2 additions and 2 deletions

View file

@ -247,7 +247,7 @@
"description": "radv/winsys: fix allocating the number of CS in the sysmem path",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -925,7 +925,7 @@ radv_amdgpu_winsys_cs_submit_sysmem(struct radeon_winsys_ctx *_ctx, int queue_id
struct radeon_cmdbuf **new_cs_array;
unsigned idx = 0;
new_cs_array = malloc(cs->num_old_cs_buffers * sizeof(*new_cs_array));
new_cs_array = malloc(number_of_ibs * sizeof(*new_cs_array));
assert(new_cs_array);
for (unsigned j = 0; j < cs->num_old_cs_buffers; j++)