From bf7120f8a09fff743f2a52b60b9fa16ca8f909de Mon Sep 17 00:00:00 2001 From: emimvi Date: Sat, 2 Sep 2023 00:11:41 +0200 Subject: [PATCH] Serialize byteOffset as size_t, avoiding cast Fixes silently writing an overflowed int in the output file. --- tiny_gltf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiny_gltf.h b/tiny_gltf.h index 3e807cc..a0d9c81 100644 --- a/tiny_gltf.h +++ b/tiny_gltf.h @@ -7124,7 +7124,7 @@ static void SerializeGltfAccessor(const Accessor &accessor, detail::json &o) { SerializeNumberProperty("bufferView", accessor.bufferView, o); if (accessor.byteOffset != 0) - SerializeNumberProperty("byteOffset", int(accessor.byteOffset), o); + SerializeNumberProperty("byteOffset", accessor.byteOffset, o); SerializeNumberProperty("componentType", accessor.componentType, o); SerializeNumberProperty("count", accessor.count, o);