mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix a stack overflow when typing long words. Limit the size of auto-added words.
This commit is contained in:
parent
63fa90a791
commit
81115075d2
@ -1169,6 +1169,9 @@ public class LatinIME extends InputMethodService
|
||||
|
||||
@Override
|
||||
public void addWord(String word, int addFrequency) {
|
||||
final int length = word.length();
|
||||
// Don't add very short or very long words.
|
||||
if (length < 2 || length > getMaxWordLength()) return;
|
||||
super.addWord(word, addFrequency);
|
||||
final int freq = getWordFrequency(word);
|
||||
if (freq > PROMOTION_THRESHOLD) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user