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
This commit is contained in:
dongseong.hwang 2015-01-22 10:40:20 -08:00 committed by Commit bot
parent 75de4f827f
commit 8f25c667ea

View File

@ -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;