From 5e912e68da5cf17ca500cf1ae8fe8c15d0b65dae Mon Sep 17 00:00:00 2001 From: Fav Date: Fri, 30 Aug 2024 05:55:18 +0800 Subject: [PATCH] Update glTF2AssetWriter.inl (#5647) The total length is incorrect when exporting gltf2 Co-authored-by: Kim Kulling --- code/AssetLib/glTF2/glTF2AssetWriter.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/AssetLib/glTF2/glTF2AssetWriter.inl b/code/AssetLib/glTF2/glTF2AssetWriter.inl index 3e42ffe57..0ca23863c 100644 --- a/code/AssetLib/glTF2/glTF2AssetWriter.inl +++ b/code/AssetLib/glTF2/glTF2AssetWriter.inl @@ -940,7 +940,7 @@ namespace glTF2 { if (outfile->Write(bodyBuffer->GetPointer(), 1, bodyBuffer->byteLength) != bodyBuffer->byteLength) { throw DeadlyExportError("Failed to write body data!"); } - if (curPaddingLength && outfile->Write(&padding, 1, paddingLength) != paddingLength) { + if (curPaddingLength && outfile->Write(&padding, 1, curPaddingLength) != curPaddingLength) { throw DeadlyExportError("Failed to write body data padding!"); } }