Merge pull request #280 from cdavis5e/fix-dedicated-alloc-segfault

MVKResource: Check that a VkDeviceMemory is nonnull before using it.
This commit is contained in:
Bill Hollings 2018-09-25 12:01:26 -04:00 committed by GitHub
commit 1f7bd607d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -24,7 +24,7 @@
VkResult MVKResource::bindDeviceMemory(MVKDeviceMemory* mvkMem, VkDeviceSize memOffset) {
// Don't do anything with a non-zero offset into a dedicated allocation.
if (mvkMem->isDedicatedAllocation() && memOffset) {
if (mvkMem && mvkMem->isDedicatedAllocation() && memOffset) {
_deviceMemory = nullptr;
return VK_SUCCESS;
}