From 8f25c667ea975c92d87ad6cb96963946f9845542 Mon Sep 17 00:00:00 2001 From: "dongseong.hwang" Date: Thu, 22 Jan 2015 10:40:20 -0800 Subject: [PATCH] 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 --- src/gpu/GrBufferAllocPool.cpp | 1 + 1 file changed, 1 insertion(+) 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(fBufferPtr) + usedBytes), 0, pad); usedBytes += pad; *offset = usedBytes; *buffer = back.fBuffer;