mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-11-23 15:30:09 +00: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
@ -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…
Reference in New Issue
Block a user