diff --git a/ICSharpCode.Decompiler/Documentation/XmlDocumentationProvider.cs b/ICSharpCode.Decompiler/Documentation/XmlDocumentationProvider.cs index b28d2f6ef..1f0b2da72 100644 --- a/ICSharpCode.Decompiler/Documentation/XmlDocumentationProvider.cs +++ b/ICSharpCode.Decompiler/Documentation/XmlDocumentationProvider.cs @@ -271,8 +271,8 @@ namespace ICSharpCode.Decompiler.Documentation char prevChar = '\0'; // buffers for use with Decoder: - byte[] input = new byte[1]; - char[] output = new char[1]; + readonly byte[] input = new byte[1]; + readonly char[] output = new char[2]; public LinePositionMapper(FileStream fs, Encoding encoding) { @@ -289,7 +289,7 @@ namespace ICSharpCode.Decompiler.Documentation if (b < 0) throw new EndOfStreamException(); input[0] = (byte)b; - decoder.Convert(input, 0, 1, output, 0, 1, false, out int bytesUsed, out int charsUsed, out _); + decoder.Convert(input, 0, 1, output, 0, output.Length, false, out int bytesUsed, out int charsUsed, out _); Debug.Assert(bytesUsed == 1); if (charsUsed == 1) {