mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Merge "Strengthen java code against bad returns from native"
This commit is contained in:
commit
f5f53c2fa6
@ -149,6 +149,9 @@ public class BinaryDictionary extends Dictionary {
|
||||
int count = getBigramsNative(mNativeDict, chars, chars.length, mInputCodes, codesSize,
|
||||
mOutputChars_bigrams, mBigramScores, MAX_WORD_LENGTH, MAX_BIGRAMS,
|
||||
MAX_PROXIMITY_CHARS_SIZE);
|
||||
if (count > MAX_BIGRAMS) {
|
||||
count = MAX_BIGRAMS;
|
||||
}
|
||||
|
||||
for (int j = 0; j < count; ++j) {
|
||||
if (codesSize > 0 && mBigramScores[j] < 1) break;
|
||||
|
Loading…
Reference in New Issue
Block a user