aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBufferAllocPool.cpp
diff options
context:
space:
mode:
authorGravatar dongseong.hwang <dongseong.hwang@intel.com>2015-01-22 10:40:20 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-22 10:40:20 -0800
commit8f25c667ea975c92d87ad6cb96963946f9845542 (patch)
treeda752a7b3eadc7be46a103cd41e23e06ada9e816 /src/gpu/GrBufferAllocPool.cpp
parent75de4f827fcc92ec129ba872924f6e81c55aa8f0 (diff)
Initialize the pad memory in GrBufferAllocPool.
Msan bot detects Use-of-uninitialized-value on the pad. BUG=445745 Review URL: https://codereview.chromium.org/865913002
Diffstat (limited to 'src/gpu/GrBufferAllocPool.cpp')
-rw-r--r--src/gpu/GrBufferAllocPool.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp
index 26a1d15837..f23311877b 100644
--- a/src/gpu/GrBufferAllocPool.cpp
+++ b/src/gpu/GrBufferAllocPool.cpp
@@ -184,6 +184,7 @@ void* GrBufferAllocPool::makeSpace(size_t size,
size_t pad = GrSizeAlignUpPad(usedBytes,
alignment);
if ((size + pad) <= back.fBytesFree) {
+ memset((void*)(reinterpret_cast<intptr_t>(fBufferPtr) + usedBytes), 0, pad);
usedBytes += pad;
*offset = usedBytes;
*buffer = back.fBuffer;