From 50a59c91def5dcb5b134e2b3369b2c52728fb055 Mon Sep 17 00:00:00 2001 From: Gobrosse Date: Fri, 11 Oct 2019 12:34:37 +0200 Subject: [PATCH] fixes crash when enumerating on some systems matches both sides for calling copy_from_slice in gfxEnumeratePhysicalDevices() --- libportability-gfx/src/impls.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libportability-gfx/src/impls.rs b/libportability-gfx/src/impls.rs index 943a577..bf89f89 100644 --- a/libportability-gfx/src/impls.rs +++ b/libportability-gfx/src/impls.rs @@ -164,7 +164,7 @@ pub extern "C" fn gfxEnumeratePhysicalDevices( (VkResult::VK_SUCCESS, num_adapters) }; - output.copy_from_slice(&instance.adapters[..count]); + output[..count].copy_from_slice(&instance.adapters[..count]); unsafe { *pPhysicalDeviceCount = count as _ }; code