From 2f286f4c208765c84ffbafb7db996fc303cb6d8f Mon Sep 17 00:00:00 2001 From: AWoloszyn Date: Wed, 13 Mar 2019 09:56:46 -0400 Subject: [PATCH] Guard invalid device memory flushes. Fixes #2617. --- gapis/api/vulkan/api/memory.api | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gapis/api/vulkan/api/memory.api b/gapis/api/vulkan/api/memory.api index 055fce2def..a5305b7c54 100644 --- a/gapis/api/vulkan/api/memory.api +++ b/gapis/api/vulkan/api/memory.api @@ -211,7 +211,7 @@ cmd VkResult vkFlushMappedMemoryRanges( } } - if !(flushRange.memory in DeviceMemories) { vkErrorInvalidDeviceMemory(flushRange.memory) } + if !(flushRange.memory in DeviceMemories) { vkErrorInvalidDeviceMemory(flushRange.memory) } else { memoryObject := DeviceMemories[flushRange.memory] mappedLocation := as!u8*(memoryObject.MappedLocation) flushStart := flushRange.offset - memoryObject.MappedOffset @@ -228,7 +228,7 @@ cmd VkResult vkFlushMappedMemoryRanges( // copy() contains an implicit read observation copy(memoryObject.Data[flushRange.offset:flushRange.offset + flushRange.size], (mappedLocation)[flushStart:flushStart + flushRange.size]) } - } + }} } return ? }