src: when checking for candidates, make sure we haven't any unprocessed…

… language data left.
This commit is contained in:
Jehan 2022-12-14 08:39:49 +01:00
parent 7f386d922e
commit 4f35cd4416

View File

@ -404,10 +404,17 @@ void nsMBCSGroupProber::CheckCandidates()
{
for (int j = 0; j < NUM_OF_LANGUAGES; j++)
{
float langConf = langDetectors[i][j]->GetConfidence();
float langConf;
/* Process any remaining language data first. */
if (codePointBufferIdx[i] > 0 && codePointBuffer[i])
langDetectors[i][j]->HandleData(codePointBuffer[i], codePointBufferIdx[i]);
/* Now check the confidence in this (charset, lang) couple. */
langConf = langDetectors[i][j]->GetConfidence();
candidates[i][j] = (cf * langConf > CANDIDATE_THRESHOLD);
}
codePointBufferIdx[i] = 0;
}
else
{