read vtable size through ReadScalar() (#5636)

This commit is contained in:
FujiZ 2019-11-26 04:52:42 +08:00 committed by Wouter van Oortmerssen
parent 136d75fa65
commit bcf1bd5c9e
1 changed files with 1 additions and 1 deletions

View File

@ -1364,7 +1364,7 @@ class FlatBufferBuilder {
it += sizeof(uoffset_t)) {
auto vt_offset_ptr = reinterpret_cast<uoffset_t *>(it);
auto vt2 = reinterpret_cast<voffset_t *>(buf_.data_at(*vt_offset_ptr));
auto vt2_size = *vt2;
auto vt2_size = ReadScalar<voffset_t>(vt2);
if (vt1_size != vt2_size || 0 != memcmp(vt2, vt1, vt1_size)) continue;
vt_use = *vt_offset_ptr;
buf_.pop(GetSize() - vtableoffsetloc);