Forced 4-bits alignment for glTF buffers

pull/1712/head
Alexis Breust 2018-01-16 09:26:00 +01:00
parent d0bf5c10f9
commit 0f4189c77e
1 changed files with 2 additions and 1 deletions

View File

@ -485,7 +485,8 @@ uint8_t* new_data;
inline size_t Buffer::AppendData(uint8_t* data, size_t length)
{
size_t offset = this->byteLength;
Grow(length);
// Force alignment to 4 bits
Grow((length + 3) & ~3);
memcpy(mData.get() + offset, data, length);
return offset;
}