diff --git a/ValveResourceFormat/ThirdParty/MeshOptimizerIndexDecoder.cs b/ValveResourceFormat/ThirdParty/MeshOptimizerIndexDecoder.cs index 760d9beb9..844f951ae 100644 --- a/ValveResourceFormat/ThirdParty/MeshOptimizerIndexDecoder.cs +++ b/ValveResourceFormat/ThirdParty/MeshOptimizerIndexDecoder.cs @@ -60,6 +60,8 @@ private static uint DecodeIndex(BinaryReader data, uint next, uint last) private static void WriteTriangle(Span destination, int offset, int indexSize, uint a, uint b, uint c) { + offset *= indexSize; + if (indexSize == 2) { BinaryPrimitives.WriteUInt16LittleEndian(destination.Slice(offset + 0), (ushort)a);