radeonsi: check the pointer before adding an offset
Otherwise callers can't detect errors. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31171>
This commit is contained in:
committed by
Marge Bot
parent
7fedd7e178
commit
bda9e1f856
@@ -954,9 +954,13 @@ static void *pre_upload_binary(struct si_screen *sscreen, struct si_shader *shad
|
||||
|
||||
return ret;
|
||||
} else {
|
||||
return sscreen->ws->buffer_map(sscreen->ws,
|
||||
void *ptr = sscreen->ws->buffer_map(sscreen->ws,
|
||||
shader->bo->buf, NULL,
|
||||
PIPE_MAP_READ_WRITE | PIPE_MAP_UNSYNCHRONIZED | RADEON_MAP_TEMPORARY) + bo_offset;
|
||||
PIPE_MAP_READ_WRITE | PIPE_MAP_UNSYNCHRONIZED | RADEON_MAP_TEMPORARY);
|
||||
if (!ptr)
|
||||
return NULL;
|
||||
|
||||
return ptr + bo_offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user