diff --git a/.pick_status.json b/.pick_status.json index 93d492336a1..58e4f0e94a4 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1224,7 +1224,7 @@ "description": "llvmpipe: handle vma allocation failure", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "a062544d3d0519aaa3845b7cfd79e925b9352a55", "notes": null diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 30d5057cf9f..9bd6ce5a4a0 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -1305,6 +1305,11 @@ llvmpipe_allocate_memory(struct pipe_screen *_screen, uint64_t size) mtx_lock(&screen->mem_mutex); mem->offset = util_vma_heap_alloc(&screen->mem_heap, mem->size, alignment); + if (!mem->offset) { + mtx_unlock(&screen->mem_mutex); + FREE(mem); + return NULL; + } if (mem->offset + mem->size > screen->mem_file_size) { /* expand the anonymous file */