Serialize byteOffset as size_t, avoiding cast

Fixes silently writing an overflowed int in the output file.
This commit is contained in:
emimvi 2023-09-02 00:11:41 +02:00
parent acf1e8a2b1
commit bf7120f8a0

View File

@ -7124,7 +7124,7 @@ static void SerializeGltfAccessor(const Accessor &accessor, detail::json &o) {
SerializeNumberProperty<int>("bufferView", accessor.bufferView, o);
if (accessor.byteOffset != 0)
SerializeNumberProperty<int>("byteOffset", int(accessor.byteOffset), o);
SerializeNumberProperty<size_t>("byteOffset", accessor.byteOffset, o);
SerializeNumberProperty<int>("componentType", accessor.componentType, o);
SerializeNumberProperty<size_t>("count", accessor.count, o);