diff --git a/src/gallium/drivers/v3d/v3d_simulator.c b/src/gallium/drivers/v3d/v3d_simulator.c index 6e2d25e9448..039672d9ca2 100644 --- a/src/gallium/drivers/v3d/v3d_simulator.c +++ b/src/gallium/drivers/v3d/v3d_simulator.c @@ -289,6 +289,9 @@ v3d_free_simulator_bo(struct v3d_simulator_bo *sim_bo) static struct v3d_simulator_bo * v3d_get_simulator_bo(struct v3d_simulator_file *file, int gem_handle) { + if (gem_handle == 0) + return NULL; + mtx_lock(&sim_state.mutex); struct hash_entry *entry = _mesa_hash_table_search(file->bo_map, int_to_key(gem_handle));