Fixed big-endian issue.

Noticed a memory read that isn't big-endian safe. Was somewhat
benign in that it would have simply caused vtable duplication
when constructing a FlatBuffer on a big-endian machine.

Change-Id: I5de3a2bb3ce6912fdd845ed40668719794920cac
parent 1e4d28bf
...@@ -522,7 +522,7 @@ class FlatBufferBuilder { ...@@ -522,7 +522,7 @@ class FlatBufferBuilder {
} }
offsetbuf_.clear(); offsetbuf_.clear();
auto vt1 = reinterpret_cast<voffset_t *>(buf_.data()); auto vt1 = reinterpret_cast<voffset_t *>(buf_.data());
auto vt1_size = *vt1; auto vt1_size = ReadScalar<voffset_t>(vt1);
auto vt_use = GetSize(); auto vt_use = GetSize();
// See if we already have generated a vtable with this exact same // See if we already have generated a vtable with this exact same
// layout before. If so, make it point to the old one, remove this one. // layout before. If so, make it point to the old one, remove this one.
......
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