mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
radeonsi: fix undefined behavior (memcpy arguments must be non-NULL)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
146927ce7b
commit
b9e6e8e7d4
1 changed files with 3 additions and 1 deletions
|
|
@ -63,7 +63,9 @@ static void *si_get_tgsi_binary(struct si_shader_selector *sel)
|
|||
/** Copy "data" to "ptr" and return the next dword following copied data. */
|
||||
static uint32_t *write_data(uint32_t *ptr, const void *data, unsigned size)
|
||||
{
|
||||
memcpy(ptr, data, size);
|
||||
/* data may be NULL if size == 0 */
|
||||
if (size)
|
||||
memcpy(ptr, data, size);
|
||||
ptr += DIV_ROUND_UP(size, 4);
|
||||
return ptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue