diff options
author | 2013-10-16 01:41:27 -0700 | |
---|---|---|
committer | 2013-10-16 01:41:27 -0700 | |
commit | 2e8536e962f24cb368d33486e7f4eafb6d381a64 (patch) | |
tree | 791717bc09239a23c1d744454e2c3607669441f5 /java/src | |
parent | 4232d440a351ffa8c712639f56c74c4d607ef079 (diff) | |
parent | 7b5f2b71f5ce8af82b4c0faad38437bca750cffe (diff) | |
download | latinime-2e8536e962f24cb368d33486e7f4eafb6d381a64.tar.gz latinime-2e8536e962f24cb368d33486e7f4eafb6d381a64.tar.xz latinime-2e8536e962f24cb368d33486e7f4eafb6d381a64.zip |
am 7b5f2b71: Fix Ver4DictDecoder.readAndFollowForwardLink().
* commit '7b5f2b71f5ce8af82b4c0faad38437bca750cffe':
Fix Ver4DictDecoder.readAndFollowForwardLink().
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java b/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java index cc6a54569..a94e04a8e 100644 --- a/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java +++ b/java/src/com/android/inputmethod/latin/makedict/Ver4DictDecoder.java @@ -319,10 +319,13 @@ public class Ver4DictDecoder extends AbstractDictDecoder { @Override public boolean readAndFollowForwardLink() { final int forwardLinkPos = mDictBuffer.position(); - final int nextAddress = forwardLinkPos + BinaryDictDecoderUtils.readSInt24(mDictBuffer); - if (nextAddress >= 0 && nextAddress < mDictBuffer.limit()) { - mDictBuffer.position(nextAddress); - return true; + int nextRelativePos = BinaryDictDecoderUtils.readSInt24(mDictBuffer); + if (nextRelativePos != FormatSpec.NO_FORWARD_LINK_ADDRESS) { + final int nextPos = forwardLinkPos + nextRelativePos; + if (nextPos >= 0 && nextPos < mDictBuffer.limit()) { + mDictBuffer.position(nextPos); + return true; + } } return false; } |