anv: Avoid null ptr dereference

Avoids the sanitizer error:

```
../src/intel/vulkan/anv_instance.c:266:37: runtime error: member access within null pointer of type 'struct anv_instance'
```

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32098>
This commit is contained in:
Matt Turner 2024-11-11 14:53:26 -05:00 committed by Marge Bot
parent b6d11ba5b4
commit 1f3e24f4f3

View file

@ -263,7 +263,7 @@ PFN_vkVoidFunction anv_GetInstanceProcAddr(
const char* pName)
{
ANV_FROM_HANDLE(anv_instance, instance, _instance);
return vk_instance_get_proc_addr(&instance->vk,
return vk_instance_get_proc_addr(instance ? &instance->vk : NULL,
&anv_instance_entrypoints,
pName);
}