diff --git a/ICSharpCode.Decompiler/Documentation/XmlDocumentationProvider.cs b/ICSharpCode.Decompiler/Documentation/XmlDocumentationProvider.cs index b28d2f6efb..1f0b2da724 100644 --- a/ICSharpCode.Decompiler/Documentation/XmlDocumentationProvider.cs +++ b/ICSharpCode.Decompiler/Documentation/XmlDocumentationProvider.cs @@ -271,8 +271,8 @@ sealed class LinePositionMapper 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 @@ public int GetPositionForLine(int line) 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) {