Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: src/gpu/vk/GrVkProgram.cpp

Issue 1737593005: Fix memory crash in vulakn writeUniformBuffers (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkProgram.cpp
diff --git a/src/gpu/vk/GrVkProgram.cpp b/src/gpu/vk/GrVkProgram.cpp
index cec3eee6f344b9dad8c886d0000d5e0bd6322bad..00f01b70c80b2aeeb7612e6e493bf76f72868113 100644
--- a/src/gpu/vk/GrVkProgram.cpp
+++ b/src/gpu/vk/GrVkProgram.cpp
@@ -202,10 +202,10 @@ void GrVkProgram::writeUniformBuffers(const GrVkGpu* gpu) {
uint32_t firstUniformWrite = 0;
uint32_t uniformBindingUpdateCount = 0;
+ VkDescriptorBufferInfo vertBufferInfo;
// Vertex Uniform Buffer
if (fVertexUniformBuffer.get()) {
++uniformBindingUpdateCount;
- VkDescriptorBufferInfo vertBufferInfo;
memset(&vertBufferInfo, 0, sizeof(VkDescriptorBufferInfo));
vertBufferInfo.buffer = fVertexUniformBuffer->buffer();
vertBufferInfo.offset = 0;
@@ -223,13 +223,13 @@ void GrVkProgram::writeUniformBuffers(const GrVkGpu* gpu) {
descriptorWrites[0].pTexelBufferView = nullptr;
}
+ VkDescriptorBufferInfo fragBufferInfo;
// Fragment Uniform Buffer
if (fFragmentUniformBuffer.get()) {
if (0 == uniformBindingUpdateCount) {
firstUniformWrite = 1;
}
++uniformBindingUpdateCount;
- VkDescriptorBufferInfo fragBufferInfo;
memset(&fragBufferInfo, 0, sizeof(VkDescriptorBufferInfo));
fragBufferInfo.buffer = fFragmentUniformBuffer->buffer();
fragBufferInfo.offset = 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698