diff options
| author | Tony Barbour <tony@LunarG.com> | 2017-05-10 11:14:03 -0600 |
|---|---|---|
| committer | Tony-LunarG <tony@lunarg.com> | 2017-05-11 14:34:43 -0600 |
| commit | 2b8725c2e537ba0c5606dd34967928db760d865e (patch) | |
| tree | 4960d2df4d00db7b30eaee7e3fcdc89570e937ed /layers/core_validation.cpp | |
| parent | 2a2dc884bdab95edbf6c7d88ac5901768c165598 (diff) | |
| download | usermoji-2b8725c2e537ba0c5606dd34967928db760d865e.tar.xz | |
layers: Validate pOffsets in vkCmdBindVertexBuffers
Change-Id: Ie618d7657af6eca555050507a623be02af2e21fe
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 2ce055d2..50030c94 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -7068,6 +7068,12 @@ VKAPI_ATTR void VKAPI_CALL CmdBindVertexBuffers(VkCommandBuffer commandBuffer, u return ValidateBufferMemoryIsValid(dev_data, buffer_state, "vkCmdBindVertexBuffers()"); }; cb_node->validate_functions.push_back(function); + if (pOffsets[i] >= buffer_state->createInfo.size) { + skip |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_EXT, + reinterpret_cast<uint64_t &>(buffer_state->buffer), __LINE__, VALIDATION_ERROR_01417, "DS", + "vkCmdBindVertexBuffers() offset (0x%" PRIxLEAST64 ") is beyond the end of the buffer. %s", + pOffsets[i], validation_error_map[VALIDATION_ERROR_01417]); + } } UpdateCmdBufferLastCmd(cb_node, CMD_BINDVERTEXBUFFER); updateResourceTracking(cb_node, firstBinding, bindingCount, pBuffers); |
