diff --git a/code/AssetLib/glTF2/glTF2AssetWriter.inl b/code/AssetLib/glTF2/glTF2AssetWriter.inl index 17e29d8e7..2c48afd1c 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!"); } }