mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 19:40:10 +01:00
zink: Initialize zink_bindless_descriptor to zero on creation
Make sure to have all fields to 0 as we are then using pipe_resource_reference on some of its fields. Fix defect reported by Coverity Scan. Uninitialized pointer read Incorrect values could be read from, or even written to, an arbitrary memory location, causing incorrect computations. CID: 1520759 Signed-off-by: Corentin Noël <corentin.noel@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27259>
This commit is contained in:
parent
3f0af613d0
commit
66cc73a304
1 changed files with 1 additions and 1 deletions
|
|
@ -2405,7 +2405,7 @@ zink_create_image_handle(struct pipe_context *pctx, const struct pipe_image_view
|
|||
debug_printf("couldn't create storage image!");
|
||||
return 0;
|
||||
}
|
||||
bd = malloc(sizeof(struct zink_bindless_descriptor));
|
||||
bd = calloc(1, sizeof(struct zink_bindless_descriptor));
|
||||
if (!bd)
|
||||
return 0;
|
||||
bd->sampler = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue