From 172b0b653b5e229d1daa8bbe69ad2d7e5fe249d1 Mon Sep 17 00:00:00 2001 From: Nicolas James Date: Sat, 4 Apr 2026 15:12:14 +1100 Subject: Fix nullptr pName in GetInstanceProcAddr --- src/layer.cc | 4 ++++ src/layer_context.hh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/layer.cc b/src/layer.cc index d3112d8..bc1ab5f 100644 --- a/src/layer.cc +++ b/src/layer.cc @@ -1002,6 +1002,10 @@ LowLatency_GetDeviceProcAddr(VkDevice device, const char* const pName) { VKAPI_ATTR PFN_vkVoidFunction VKAPI_CALL LowLatency_GetInstanceProcAddr(VkInstance instance, const char* const pName) { + if (!pName) { + return nullptr; + } + if (const auto it = instance_functions.find(pName); it != std::end(instance_functions)) { diff --git a/src/layer_context.hh b/src/layer_context.hh index 049684d..5c16926 100644 --- a/src/layer_context.hh +++ b/src/layer_context.hh @@ -82,7 +82,7 @@ class LayerContext final : public Context { std::shared_ptr> get_context(const DT& dt) { const auto key = get_key(dt); - const auto lock = std::scoped_lock(this->mutex); + const auto lock = std::scoped_lock{this->mutex}; const auto it = this->contexts.find(key); assert(it != std::end(this->contexts)); -- cgit v1.2.3