diff options
author | Erik Faye-Lund <[email protected]> | 2019-11-27 17:17:08 +0100 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-11-29 09:54:25 +0100 |
commit | bda64440e45233d0bfd51b9c1596ae3a1788c3fd (patch) | |
tree | eb712cab72818dd40e65a79032b947e30dec0781 /src | |
parent | 8e1dca35abe13b57b34ea30d14f9ed55f558af14 (diff) |
zink: avoid NULL-deref
zink_render_pass_reference will dereference the memory 'dst' points at,
which can't really go well. All we want to do here is to increase the
reference-count, so let's use a different helper for that instead.
CoverityID: 1455200
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/zink/zink_program.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 92a75489cf5..95b47a69d93 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -210,9 +210,8 @@ reference_render_pass(struct zink_screen *screen, struct set_entry *entry = _mesa_set_search(prog->render_passes, render_pass); if (!entry) { - struct zink_render_pass *tmp = NULL; entry = _mesa_set_add(prog->render_passes, render_pass); - zink_render_pass_reference(screen, &tmp, render_pass); + pipe_reference(NULL, &render_pass->reference); } } |