Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ec961de authored by Yusuke Nojima's avatar Yusuke Nojima Committed by Android (Google) Code Review
Browse files

Merge "Fix editDistance() not to access the outside of mEditDistanceTable"

parents 3ea503c8 2e496f5d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -119,8 +119,9 @@ private:
    int mTerminalInputIndex;
    int mTerminalOutputIndex;
    unsigned short mWord[MAX_WORD_LENGTH_INTERNAL];
    // Edit distance calculation requires a buffer with (N+1)^2 length for the input length N.
    // Caveat: Do not create multiple tables per thread as this table eats up RAM a lot.
    int mEditDistanceTable[MAX_WORD_LENGTH_INTERNAL * MAX_WORD_LENGTH_INTERNAL];
    int mEditDistanceTable[(MAX_WORD_LENGTH_INTERNAL + 1) * (MAX_WORD_LENGTH_INTERNAL + 1)];

    CorrectionState mCorrectionStates[MAX_WORD_LENGTH_INTERNAL];