mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 00:00:12 +01:00
zink: do not dereference null-pointer
The "locations" pointer can be null here, and memcpying from a null pointer is not okay. CID: 1485978 Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12559>
This commit is contained in:
parent
3fde1c4242
commit
4cc3554d85
1 changed files with 3 additions and 1 deletions
|
|
@ -2059,7 +2059,9 @@ zink_set_sample_locations(struct pipe_context *pctx, size_t size, const uint8_t
|
|||
ctx->sample_locations_changed = ctx->gfx_pipeline_state.sample_locations_enabled;
|
||||
if (size > sizeof(ctx->sample_locations))
|
||||
size = sizeof(ctx->sample_locations);
|
||||
memcpy(ctx->sample_locations, locations, size);
|
||||
|
||||
if (locations)
|
||||
memcpy(ctx->sample_locations, locations, size);
|
||||
}
|
||||
|
||||
static VkAccessFlags
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue