Commit 6350f734 by Geoff Lang Committed by Shannon Woods

Fix potential segfault when calling glBufferData with NULL data pointer.

TRAC #23311 Signed-off-by: Nicolas Capens Signed-off-by: Shannon Woods Authored-by: Geoff Lang
parent 574d9dd0
...@@ -54,7 +54,10 @@ void BufferStorage9::setData(const void* data, unsigned int size, unsigned int o ...@@ -54,7 +54,10 @@ void BufferStorage9::setData(const void* data, unsigned int size, unsigned int o
} }
mSize = std::max(mSize, offset + size); mSize = std::max(mSize, offset + size);
memcpy(reinterpret_cast<char*>(mMemory) + offset, data, size); if (data)
{
memcpy(reinterpret_cast<char*>(mMemory) + offset, data, size);
}
} }
void BufferStorage9::copyData(BufferStorage* sourceStorage, unsigned int size, void BufferStorage9::copyData(BufferStorage* sourceStorage, unsigned int size,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment