Skip to content

Commit

Permalink
Guard invalid device memory flushes.
Browse files Browse the repository at this point in the history
Fixes #2617.
  • Loading branch information
AWoloszyn committed Mar 15, 2019
1 parent 8168d88 commit 2f286f4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gapis/api/vulkan/api/memory.api
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ?
}
Expand Down

0 comments on commit 2f286f4

Please sign in to comment.