Skip to content
Snippets Groups Projects
Commit df4e0430 authored by Amith Yamasani's avatar Amith Yamasani
Browse files

Fix a crash in the dictionary due to releasing a null array.

parent 1b62ff1a
No related branches found
No related tags found
No related merge requests found
......@@ -103,12 +103,14 @@ static int latinime_BinaryDictionary_getSuggestions(
int count = dictionary->getSuggestions(inputCodes, arraySize, (unsigned short*) outputChars, frequencies,
maxWordLength, maxWords, maxAlternatives, skipPos, nextLetters, nextLettersSize);
env->ReleaseIntArrayElements(frequencyArray, frequencies, 0);
env->ReleaseIntArrayElements(inputArray, inputCodes, JNI_ABORT);
env->ReleaseCharArrayElements(outputArray, outputChars, 0);
env->ReleaseIntArrayElements(nextLettersArray, nextLetters, 0);
if (nextLetters) {
env->ReleaseIntArrayElements(nextLettersArray, nextLetters, 0);
}
return count;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment