Skip to content

Commit

Permalink
fix: 微软自学习词汇 数组越界
Browse files Browse the repository at this point in the history
  • Loading branch information
nopdan committed Dec 21, 2024
1 parent 9ce6aae commit 67b0e61
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ImeWlConverterCore/IME/Win10MsPinyinSelfStudy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ public WordLibraryList Import(string path)
var byte2 = new byte[2];
fp.Read(byte2, 0, 2);
var pyIndex = BitConverter.ToInt16(byte2, 0);
pinyin[j] = pinyinIndex[pyIndex];
if (pyIndex >= 0 && pyIndex < pinyinIndex.Length)
pinyin[j] = pinyinIndex[pyIndex];
}
re.Add(
new WordLibrary()
Expand Down

0 comments on commit 67b0e61

Please sign in to comment.