Merge pull request #29011 from zann1x/master

Initialize padding on PoolByteArray serialization
This commit is contained in:
Rémi Verschelde 2019-05-21 10:07:26 +02:00 committed by GitHub
commit 9065cc2402
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1231,11 +1231,15 @@ Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bo
buf += 4;
PoolVector<uint8_t>::Read r = data.read();
copymem(buf, &r[0], datalen * datasize);
buf += datalen * datasize;
}
r_len += 4 + datalen * datasize;
while (r_len % 4)
while (r_len % 4) {
r_len++;
if (buf)
*(buf++) = 0;
}
} break;
case Variant::POOL_INT_ARRAY: {